accept

accept returns a new socket that corresponds to an established connection from the listening socket queue. This function applies only to stream sockets.

Syntax

SOCKET accept(
    __in SOCKET s,
    __out struct sockaddr *addr,
    __inout   int *addrlen
);

Parameters

s

Socket descriptor for a stream socket in the listening state with the listen function.

addr

Pointer to addr structure where the source address of the connection request will be received.

addrlen

Pointer to an integer containing the size of the given space pointed to by addr. Upon return, addrlen shall be modified to reflect the size of the address returned in addr.

Return Values

INVALID_SOCKET if the function fails

Use WSAGetLastError to retrieve a specific error code.

IntervalZero.com | Support | Give Feedback