SIO_WSK_SET_REMOTE_ADDRESS

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

If a WSK application sets a fixed remote transport address for a datagram socket, all datagrams that are sent over the socket are sent to the fixed remote transport address, and only datagrams that are received from the fixed remote transport address are accepted.

A WSK application can override a fixed remote 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 remote transport address. However, any responses that are sent back from an alternative remote transport address will not be accepted.

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

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

ParameterValue

RequestType

WskIoctl

ControlCode

SIO_WSK_SET_REMOTE_ADDRESS

Level

0

InputSize

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

InputBuffer

A pointer to a structure that specifies a fixed remote 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 remote transport address for a datagram socket, a WSK application calls the WskControlSocket function with the following parameters.

ParameterValue

RequestType

WskIoctl

ControlCode

SIO_WSK_SET_REMOTE_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 remote 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)

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft