u8 netStatus (u8 socketNum)
socketNum : The socket number (0~3) |
returns a value indicating the connection status |
Gets the connection status of the socket, socketNum. Constants have already been predefined for convenience.
Value | Defined Constant | Description |
---|---|---|
0x00 | SOCK_CLOSED | The socket is closed. |
0x13 | SOCK_INIT | The socket has been opened. |
0x14 | SOCK_LISTEN | The socket is listening for connections. |
0x15 0x16 0x17 | SOCK_SYNSENT SOCK_SYNRECV SOCK_ESTABLISHED | When a connection is being made, the two endpoints must share a series of handshaking packets with one another until the connection is finally established. When a socket is connecting, it may be in any one of these states until the connection is established. |
0x18 0x1A 0x1B 0x1C 0x1D | SOCK_FIN_WAIT SOCK_CLOSING SOCK_TIME_WAIT SOCK_CLOSE_WAIT SOCK_LAST_ACK | When a connection is closed, the two connection endpoints must close in an orderly fashion sending a series of handshaking packets to one another until the connection is finally closed. When a socket is disconnecting, it may be in any one of these states until it is closed. |