Group: Windows Sockets 2 (Winsock) - Library: ws2_32
How to create non-blocking Winsock server
SOCKET accept(
SOCKET s,
struct sockaddr* addr,
int* addrlen
); DECLARE INTEGER accept IN ws2_32;
INTEGER s,;
STRING @ addr,;
INTEGER @ addrlen
s [in] Descriptor identifying a socket that has been placed in a listening state with the listen function. The connection is actually made with the socket that is returned by accept.
addr [out] Optional pointer to a buffer that receives the address of the connecting entity, as known to the communications layer.
addrlen [out] Optional pointer to an integer that contains the length of addr.
If no error occurs, accept returns a value of type SOCKET that is a descriptor for the new socket. This returned value is a handle for the socket on which the actual connection is made.
Otherwise, a value of INVALID_SOCKET is returned, and a specific error code can be retrieved by calling WSAGetLastError.
Home