SIO_WSK_SET_SENDTO_ADDRESS

The SIO_WSK_SET_SENDTO_ADDRESS socket I/O control operation allows a WSK application to specify a fixed destination transport address for a datagram socket. This socket I/O control operation applies only to datagram sockets.

If a WSK application sets a fixed destination transport address for a datagram socket, all datagrams that are sent over the socket are sent to the fixed destination transport address. However, datagrams that are received on the socket will be accepted from any transport address.

A WSK application can override a fixed destination transport address when it sends a datagram over the socket by specifying an alternative remote transport address in the RemoteAddress parameter when calling the WskSendTo function. In this situation, the datagram is sent to the alternative remote transport address instead of the fixed destination transport address.

If a WSK application uses this socket I/O control operation to specify a fixed destination transport address, it must do so after the datagram socket has been bound to a local transport address.

To set a fixed destination transport address for a datagram socket, a WSK application calls the WskControlSocket function with the following parameters.

Parameter Value

RequestType

WskIoctl

ControlCode

SIO_WSK_SET_SENDTO_ADDRESS

Level

0

InputSize

The size of the SOCKADDR structure that is pointed to by the InputBuffer parameter.

InputBuffer

A pointer to a structure that specifies a fixed destination transport address for the datagram socket. The pointer must be a pointer to the specific SOCKADDR structure type that corresponds to the address family that the WSK application specified when it created the datagram socket.

OutputSize

0

OutputBuffer

NULL

OutputSizeReturned

NULL

To clear a fixed destination transport address for a datagram socket, a WSK application calls the WskControlSocket function with the following parameters.

Parameter Value

RequestType

WskIoctl

ControlCode

SIO_WSK_SET_SENDTO_ADDRESS

Level

0

InputSize

0

InputBuffer

NULL

OutputSize

0

OutputBuffer

NULL

OutputSizeReturned

NULL

A WSK application must specify a pointer to an IRP when calling the WskControlSocket function to set or clear a fixed destination transport address for a datagram socket.

Requirements

Version

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

Header

Wsk.h (include Wsk.h)