Bewerken

Delen via


SO_CONDITIONAL_ACCEPT

The state of the SO_CONDITIONAL_ACCEPT socket option determines whether conditional acceptance mode is enabled on a listening socket. This socket option applies only to listening sockets.

If a WSK application sets this socket option, it must do so before the listening socket is bound to a local transport address.

To set the state of this socket option, a WSK application calls the WskControlSocket function with the following parameters.

Parameter Value

RequestType

WskSetOption

ControlCode

SO_CONDITIONAL_ACCEPT

Level

SOL_SOCKET

InputSize

sizeof(ULONG)

InputBuffer

A pointer to a ULONG-typed variable that contains the value for the new state of the socket option:

0: Disable conditional accept mode

1: Enable conditional accept mode

OutputSize

0

OutputBuffer

NULL

OutputSizeReturned

NULL

To retrieve the state of this socket option, a WSK application calls the WskControlSocket function with the following parameters.

Parameter Value

RequestType

WskGetOption

ControlCode

SO_CONDITIONAL_ACCEPT

Level

SOL_SOCKET

InputSize

0

InputBuffer

NULL

OutputSize

sizeof(ULONG)

OutputBuffer

A pointer to a ULONG-typed variable that receives the value of the state of the socket option:

0: Conditional accept mode is disabled

1: Conditional accept mode is enabled

OutputSizeReturned

NULL

A WSK application must specify a pointer to an IRP when calling the WskControlSocket function to set or retrieve the state of the SO_CONDITIONAL_ACCEPT socket option.

The default state of this socket option is that conditional accept mode is disabled.

Some transport protocols might not support conditional accept mode on listening sockets.

For more information about conditionally accepting incoming connections, see Listening for and Accepting Incoming Connections.

Requirements

Version

Available in Windows Vista and later versions of the Windows operating systems.

Header

Ws2def.h (include Wsk.h)