# Status (TCPX)

> [HTML Version](status(tcpx).htm)

This table lists details relating to the interpretation of the _status_ parameter, based on the _opcode_. 

| | |
|------|------|
| **Symbol** | **Interpretation of Status Returned** |
| TCPOP\_ACCEPT | _Status_ >= 0 indicates success. Any value > 0 implies that you had data in the _buffer_ parameter, which was sent unsolicited to the client - up to 32 bytes. That is an unusual protocol though, and likely to confuse the client.  |
| TCPOP\_WRITE | _Status_ returns the number of bytes written. <0 indicates an error. Note that for non-blocking connections, a special error value (EWOULDBLOCK, which is -10035 for Windows and typically -11 for Unix) is returned if the socket cannot accept the data immediately. All other errors would suggest a permanent problem requiring the socket to be closed. |
| TCPOP\_READ | _Status_ returns the number of bytes read. <0 indicates an error. See note above for TCPOP\_WRITE about the special EWOULDBLOCK error. |
| TCPOP\_SHUTDOWN | Returns 0 for success, <0 for error. |
| TCPOP\_CLOSE | Returns 0 for success, <0 for error. |
| TCPOP\_CHECK | Returns 0 to indicate that the socket is not ready—that is, there is no data to read, or, in the case of [Asynchronous Client Connections](asynchronousclientcon.md), the socket is not yet connected. <0 indicates an error; probably the socket has been closed at the other end, or the asynchronous connection attempt failed. 1 indicates that the socket has data to read, or the asynchronous connection has successfully completed. |
| TCPOP\_CHKQTY | Returns the number of bytes available to read, or <0 for an error. |
| TCPOP\_CONNECT | Returns 0 for a successful normal connection, else <0 for error. In the case of [Asynchronous Client Connections](asynchronousclientcon.md), 0 indicates that the connection attempt is in progress, while 1 indicates that it connected successfully. |
| TCPOP\_ERRMSG | _Status_ should be set to the error code (probably returned from the previous operation) in order to get the error description. This is the one case where _status_ is used for input to the subroutine rather than output from it. |




