WSK_SOCKET structure (wsk.h)

The WSK_SOCKET structure defines a socket object for a socket.

Syntax

typedef struct _WSK_SOCKET {
  const VOID *Dispatch;
} WSK_SOCKET, *PWSK_SOCKET;

Members

Dispatch

A pointer to a constant provider dispatch structure. This structure is a dispatch table that contains pointers to a socket's functions. Depending on the WSK socket category of the socket, this pointer is a pointer to one of the following structures:

Socket category Dispatch table structure
Basic socket WSK_PROVIDER_BASIC_DISPATCH
Listening socket WSK_PROVIDER_LISTEN_DISPATCH
Datagram socket WSK_PROVIDER_DATAGRAM_DISPATCH
Connection-oriented socket WSK_PROVIDER_CONNECTION_DISPATCH
Stream socket WSK_PROVIDER_STREAM_DISPATCH

Remarks

The WSK subsystem allocates and fills in a WSK_SOCKET structure whenever a new socket is created. A WSK application receives a pointer to the WSK_SOCKET structure for a socket from the WSK subsystem in one of the following ways:

  • The WSK application calls the WskSocket function to create a socket.
  • The WSK application calls the WskSocketConnect function to create, bind, and connect a connection-oriented socket.
  • The WSK application calls the WskAccept function to accept an incoming connection-oriented socket on a listening socket.
  • The WSK subsystem calls the WSK application's WskAcceptEvent event callback function to notify the WSK application that an incoming connection-oriented socket has been accepted on a listening socket.
A WSK application passes the pointer to a socket's WSK_SOCKET structure when calling any of the socket's functions.

The WSK subsystem frees the memory for the WSK_SOCKET structure when the WSK application calls the WskCloseSocket function to close the socket.

Requirements

Requirement Value
Minimum supported client Available in Windows Vista and later versions of the Windows operating systems.
Header wsk.h (include Wsk.h)

See also

WSK_PROVIDER_BASIC_DISPATCH

WSK_PROVIDER_CONNECTION_DISPATCH WSK_PROVIDER_DATAGRAM_DISPATCH

WSK_PROVIDER_LISTEN_DISPATCH

WSK_PROVIDER_STREAM_DISPATCH

WskAccept

WskAcceptEvent

WskCloseSocket

WskSocket

WskSocketConnect