|
The SOCKET.INFO() function returns information about an open socket.
Format
SOCKET.INFO(skt, key)
where
| skt | is the socket variable for an open socket. |
| key | identifies the information to be returned: |
| SKT$INFO.OPEN | Is skt a socket variable? Returns True or False. |
| SKT$INFO.TYPE | Type or socket. Returns one of the following values according to which socket function was used to open the socket: |
| SKT$INFO.PORT | Port number. |
| SKT$INFO.IP.ADDR | Peer IP address. When used with a server socket, this will be a null string if the addr argument to the CREATE.SERVER.SOCKET() was null. |
| SKT$INFO.BLOCKING | Default blocking mode. |
| SKT$INFO.NO.DELAY | Nagle algorithm disabled? |
| SKT$INFO.KEEP.ALIVE | Send keep alives? |
| SKT$INFO.PEER.PORT | Port number at other end of connection. |
| SKT$INFO.NAME | Pathname for Unix local socket. |
| SKT$INFO.LOCAL.NAME | Local IP address on established TCP connection. |
| SKT$INFO.PEER.NAME | Reverse DNS lookup for peer name. Returns a null string if unavailable. |
The SOCKET.INFO() function returns information about an open socket as shown in the parameter descriptions above.
The value returned by SKT$INFO.EVENTS is an additive value formed from:
1
|
SKT$READ_EVENT
|
A new connection is on a server socket
Data is available to be read with READ.SOCKET()
The connection has been closed
|
2
|
SKT$WRITE_EVENT
|
Data can be sent with WRITE.SOCKET()
|
4
|
SKT$EXCEPTION_EVENT
|
An exception has occurred
|
See also:
Using Socket Connections, ACCEPT.SOCKET.CONNECTION, CLOSE.SOCKET, CREATE.SERVER.SOCKET(), OPEN.SOCKET(), READ.SOCKET(), SELECT.SOCKET(), SERVER.ADDR(), SET.SOCKET.MODE(), WRITE.SOCKET()
|