WSAAccept

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

Syntax

SOCKET WSAAccept(
    __in SOCKET s,
    __out struct sockaddr *addr,
    __inout LPINT addrlen,
    __in LPCONDITIONPROC lpfnCondition,
    __in DWORD dwCallbackData
);

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.

lpfnCondition

Ignored. The address of an optional, application-specified condition function that will make an accept/reject decision based on the caller information passed in as parameters, and optionally create or join a socket group by assigning an appropriate value to the result parameter g of this function. If this parameter is NULL, then no condition function is called.

dwCallbackData

Ignored. Callback data passed back to the application-specified condition function as the value of the dwCallbackData parameter passed to the condition function. This parameter is only applicable if the lpfnCondition parameter is not NULL. This parameter is not interpreted by Windows Sockets.

Return Values

INVALID_SOCKET if the function fails

Use WSAGetLastError to retrieve a specific error code.

Requirements

Library Rtxtcpip.lib
IntervalZero.com | Support | Give Feedback