PFN_WSK_LISTEN callback function

The WskListen function enables a stream socket to listen for incoming connections at the socket's bound address.

Syntax

PFN_WSK_LISTEN PfnWskListen;

NTSTATUS PfnWskListen(
  PWSK_SOCKET Socket,
  PIRP Irp
)
{...}

Parameters

Socket

A pointer to a WSK_SOCKET structure that specifies the socket object for the stream socket that is listening for an incoming connection. This socket must have previously been bound to a local transport address by calling WskBind.

Irp

A pointer to a caller-allocated IRP that the WSK subsystem uses to complete the listen operation asynchronously. For more information about using IRPs with WSK functions, see Using IRPs with Winsock Kernel Functions.

Return Value

WskListen returns one of the following NTSTATUS codes:

Return code Description
STATUS_SUCCESS
The stream socket listened for an incoming connection successfully. The IRP will be completed with success status.
STATUS_PENDING
The IRP has been queued by the WSK subsystem, which is waiting for an incoming connection on the stream socket.
STATUS_FILE_FORCED_CLOSED
The socket is no longer functional. The IRP will be completed with failure status. The WSK application must call the WskCloseSocket function to close the socket as soon as possible.
Other status codes
An error occurred. The IRP will be completed with failure status.

Remarks

A WSK application can call the WskListen function only on a stream socket that the application previously bound to a local transport address by calling the WskBind function. Once WskListen is successfully called on a stream socket, the socket is committed to a listening socket flow and can no longer call connection-oriented socket functions.

Requirements

   
Minimum supported client Windows 10, version 1703
Target Platform Universal
Header wsk.h (include Wsk.h)
IRQL "<= DISPATCH_LEVEL"

See Also

WSK_PROVIDER_STREAM_DISPATCH

WSK_SOCKET

WskAccept

WskBind

WskCloseSocket