Advertisement

socket超时配置ioctlsocket函数解析

阅读量:

首先参考MSDN的官方定义说明:

int ioctlsocket( SOCKET s, long cmd, u_long FAR *argp );

参数说明

s

[in] 用于标识一个套接字的描述符。

cmd

[in] 在套接字s上执行的操作指令。

argp

[in, out] 指向与cmd相关的参数的指针。

返回值

若操作成功完成,ioctlsocket函数将返回零。若出现错误,则返回SOCKET_ERROR值,并可通过调用WSAGetLastError获取具体的错误代码。

Error code Meaning
WSANOTINITIALISED A successful WSAStartup call must occur before using this function.
WSAENETDOWN The network subsystem has failed.
WSAEINPROGRESS A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function.
WSAENOTSOCK The de

全部评论 (0)

还没有任何评论哟~