Accepts a pending client connection from a TCP server.
Takes a server handle (Int).
Returns a client stream handle on success, 0 if no connection is pending, or -1 on error.
Network
Parameters & Returns
Parameters
serverHandleInt
Returns
Int
Quick Summary
Accepts a pending client connection from a TCP server.
Takes a server handle (Int).
Returns a client stream handle on success, 0 if no connection is pending, or -1 on error.
Technical Exegesis...
Attempts to accept a pending client connection from the server socket. Returns a client stream handle on success, 0 if no connection is pending (WSAEWOULDBLOCK), or -1 on error. The server is non-blocking, so it returns immediately if no clients are waiting.
Uses accept to get the client socket and sets it to non-blocking mode. The returned handle can be used with netReadTCPStream, netWriteTCPStream, netTCPStreamIP, netTCPStreamPort, and netCloseTCPStream. Check for 0 (no pending connection) vs -1 (error).
Attempts to accept a pending client connection from the server socket. Returns a client stream handle on success, 0 if no connection is pending (WSAEWOULDBLOCK), or -1 on error. The server is non-blocking, so it returns immediately if no clients are waiting.
Uses accept to get the client socket and sets it to non-blocking mode. The returned handle can be used with netReadTCPStream, netWriteTCPStream, netTCPStreamIP, netTCPStreamPort, and netCloseTCPStream. Check for 0 (no pending connection) vs -1 (error). Useful for implementing multi-client servers.