SET.SOCKET.MODE()

SET.SOCKET.MODE()

Top  Previous  Next

 

The SET.SOCKET.MODE() function sets parameters for an open socket.

 

 

Format

 

SET.SOCKET.MODE(skt, key, value)

 

where

 

sktis the socket variable for an open socket.

 

keyidentifies the mode to be set:
SKT$INFO.BLOCKINGDefault to blocking mode?
SKT$INFO.NO.DELAYNagle algorithm disabled?
SKT$INFO.KEEP.ALIVESend keep alives?
SKT$INFO.TRACEActivate socket tracing to the file pathname in value. A null pathname turns off tracing.
SKT$INFO.EVENTSSpecify events to be monitored for use with SELECT.SOCKET().
SKT$INHERITABLEMake the socket inheritable.

 

valueis the required value of the parameter. Except as explicitly shown above, this is a Boolean value enabling or disabling the mode identified by key.

 

 

The SET.SOCKET.MODE() function returns True if the action is successful, False if it fails. The STATUS() function can be used to determine the cause of failure.

 

The SKT$INFO.EVENTS mode allows a program to specify events that are to be monitored for the socket when using the SELECT.SOCKET() function. The value argument is an additive value chosen from:

1

SKT$READ_EVENT

Notify availability of a new connection on a server socket

Notify availability of data that can be read with READ.SOCKET()

Notify closure of connection

2

SKT$WRITE_EVENT

Notify when data can be sent with WRITE.SOCKET()

4

SKT$EXCEPTION_EVENT

Notify exceptions

 

 

See also:

Using Socket Connections, ACCEPT.SOCKET.CONNECTION, CLOSE.SOCKET, CREATE.SERVER.SOCKET(), OPEN.SOCKET(), READ.SOCKET(), SELECT.SOCKET(), SERVER.ADDR(), SOCKET.INFO(), WRITE.SOCKET()