This table lists all of the opcodes and describes the interpretation of the flags parameter for each. Note that in several cases, such as with the read, write and check operations, the value of flags relates to a number of data bytes, rather than to bit values as in the Flags1 table..
|
Symbol |
Interpretation of Flags Parameter |
|
TCPOP_ACCEPT |
TCPXFLG_BLOCK sets blocking mode, which means that read and write calls wait until they can be completed or the timer expires; in non-blocking mode, if timer=0 and the read/write operation cannot be immediately completed, an error status is returned. See Comments section for notes on TCPXFLG_LISTEN (4), TCPXFLG_ASYNC (8), TCPXFLG_KEEPLISTEN (16). |
|
TCPOP_WRITE |
Specifies the number of bytes to write. Must be less than or equal to the size of buffer, unless buffer is subscripted, in which case we just trust the flags value. If flags=0 (or not specified), writes the entire buffer block. If flags non-zero, the specified number of bytes are written. In order to minimize partial packet writes, we set the send buffer low water mark to match the number of bytes to write, so that we do not start the operation unless the socket buffer has sufficient space. If timer > 0, it waits until the timer expires or the packet is fully written. If timer = 0 and the connection is non-blocking, it returns an error ("EWOULDBLOCK") if the packet cannot be written immediately. Otherwise it waits indefinitely, for the packet to be entirely written or the socket is closed at the other end. This is one case where you might have a problem if you use a packet size larger than the OS supports. |
|
TCPOP_READ |
Specifies the number of bytes to read. 0 means read whatever is available (from 1 byte to size of buffer). Otherwise, if timer > 0, subroutine will wait until the required number of bytes is read (up to timer limit). If timer = 0, for non-blocking connections, this size is only an upper limit; the routine will return as soon as the interface indicates there is data available (even if not the requested number of bytes.) For blocking connections (with timer = 0), the subroutine will wait until the # of bytes is received, or the socket is closed at the other end. |
|
TCPOP_SHUTDOWN |
0 indicates a shutdown in both directions. Otherwise, you can shut down just one direction by specifying either TCPXFLG_SHUTRD (32) or TXPXFLG_SHUTWR (64). |
|
TCPOP_CLOSE |
flags not used. |
|
TCPOP_CHECK |
If timer specified, flags is ignored and timer is used. If timer not specified, flags specifies how long to wait before returning status 0 if no data avail. If flags is F6 then it is interpreted as fractional seconds; otherwise it is interpreted as milliseconds. (You should specify timer in all new programs; the option to exclude it is only supported for backward compatibility with TCPCLI and TCPSRV, and is deprecated.)
See Asynchronous Client Connections for special considerations involving flags and TCPOP_CHECK. |
|
TCPOP_CHKQTY |
flags not used. |
|
TCPOP_CONNECT |
TCPXFLG_BLOCK sets blocking connection (see TCPOP_ACCEPT) TCPXFLG_ASYNC sets asynchronous mode (see Asynchronous Client Connections). |
|
TCPOP_CONNECT_OLD |
TCPXFLG_BLOCK sets blocking connection (see TCPOP_ACCEPT) |
|
TCPOP_ERRMSG |
flags not used. |