WSAIoctl
The WSAIoctl function controls the mode of a socket.
int WSAIoctl(
SOCKET s,
DWORD dwIoControlCode,
LPVOID lpvInBuffer,
DWORD cbInBuffer,
LPVOID lpvOutBuffer,
DWORD cbOutBuffer,
LPDWORD lpcbBytesReturned,
LPWSAOVERLAPPED lpOverlapped,
LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
);
Parameters
s
[in] Descriptor identifying a socket.
dwIoControlCode
[in] Control code of operation to perform.
lpvInBuffer
[in] Pointer to the input buffer.
cbInBuffer
[in] Size of the input buffer.
lpvOutBuffer
[out] Pointer to the output buffer.
cbOutBuffer
[in] Size of the output buffer.
lpcbBytesReturned
[out] Pointer to actual number of bytes of output.
lpOverlapped
[in] Pointer to a WSAOVERLAPPED structure (ignored for nonoverlapped sockets).
lpCompletionRoutine
[in] Pointer to the completion routine called when the operation has been completed (ignored for nonoverlapped sockets).
SIO_RCVALL
Enables a socket to receive all IP packets on the network. The socket handle passed to the WSAIoctl function must be of AF_INET address family, SOCK_RAW socket type, and IPPROTO_IP protocol. The socket also must be bound to an explicit local interface, which means that you cannot bind to INADDR_ANY.
Once the socket is bound and the ioctl set, calls to the WSARecv or recv functions return IP datagrams passing through the given interface. Note that you must supply a sufficiently large buffer. Setting this ioctl requires Administrator privilege on the local machine. SIO_RCVALL is available in Windows 2000 and later versions of Windows.
WSAIoctl
最新推荐文章于 2022-10-20 14:57:51 发布