next up previous contents index
Next: Protocol-Specific Control Operations Up: Control Operations Previous: Control Operations

Standard Control Operations

 

Operations Common to Both Protocols and Sessions

 

These operations can be performed on both protocols and sessions.

GETMYHOST, GETMYHOSTCOUNT

When used on a protocol, GETMYHOST asks for all possible host addresses for the local host. When used on a session, GETMYHOST asks for the local host addresses actually being used on the connection. If the buffer is too small for all of the hosts, GETMYHOST will write as many hosts as the buffer allows (GETMYHOST with a buffer large enough to hold one host will return the most common or default host). GETMYHOSTCOUNT asks for the number of hosts which could be returned by GETMYHOST.

GETMAXPACKET, GETOPTPACKET

Treats the buffer as a pointer to an integer and sets it to the length of the longest message that the protocol can deliver (GETMAXPACKET) or the length of the longest message that can be delivered without fragmentation (GETOPTPACKET). A protocol typically implements this operation by querying its lower protocol and then subtracting its header length.

Although GETMAXPACKET and GETOPTPACKET can be performed on protocols, it is preferable to use them on sessions, since different sessions of the same protocol may return different values.

RESOLVE, RRESOLVE

These operations map high-level addresses into low-level addresses (RESOLVE) and vice versa (RRESOLVE).

Session-Only Operations

 

These operations can be performed on sessions only.

GETPEERHOST, GETPEERHOSTCOUNT

GETPEERHOST returns the host addresses of all peers of a session. It is an error to submit a buffer that is too small for all of the peer hosts, and -1 will be returned. GETPEERHOSTCOUNT asks for the number of hosts which will be returned by GETPEERHOST.

GETMYPROTO, GETPEERPROTO

Treats the buffer as a pointer to a long and sets it to the local or remote ``protocol number'' of the session. For example, UDP returns the local UDP port from a GETMYPROTO operation.

FREERESOURCES

Treats the buffer as a pointer to an XkHandle. This value is interpreted as the result of a previous xPush and frees the resources associated with that message.

SETNONBLOCKINGIO

Treats the buffer as a pointer to an int (non-zero == TRUE). This operation is interpreted by sessions which do output buffering. Such sessions may block threads executing an xPush until sufficient buffer space is available to hold the outgoing message. If SETNONBLOCKINGIO with value TRUE is performed on such a session, a thread which would normally block in such a situation returns with an XMSG_ERR_WOULDBLOCK message handle instead.


next up previous contents index
Next: Protocol-Specific Control Operations Up: Control Operations Previous: Control Operations



Larry Peterson
Tue Jul 1 14:50:34 MST 1997