WSAStartup
来源:互联网 发布:股票编程接口 编辑:程序博客网 时间:2024/04/28 09:39
【WSAStartup】 初始化套接字
#include<windows.h>
#pragma comment(lib,"ws2_32.lib")
int WSAStartup(
_In_ WORD wVersionRequested,
_Out_ LPWSADATA lpWSAData
);
_In_ WORD wVersionRequested //要使用的socket api的版本
_Out_ LPWSADATA lpWSAData //用来保存返回结果的指标
【返回值】
If successful, the WSAStartup function returns zero. Otherwise, it returns one of the error codes listed below.
The WSAStartup function directly returns the extended error code in the return value for this function. A call to the WSAGetLastError function is not needed and should not be used.
Error code
Meaning
WSASYSNOTREADY
The underlying network subsystem is not ready for network communication.
WSAVERNOTSUPPORTED
The version of Windows Sockets support requested is not provided by this particular Windows Sockets implementation.
WSAEINPROGRESS
A blocking Windows Sockets 1.1 operation is in progress.
WSAEPROCLIM
A limit on the number of tasks supported by the Windows Sockets implementation has been reached.
WSAEFAULT
The lpWSAData parameter is not a valid pointer.
WORD 分配和 (可选) 初始化一个单词 (2 字节) 的每 initializer的存储。 ,因为类型说明符任何位置类型是非法的,也可以使用。
wVersionRequested [in]
最高版本的Windows Sockets规范,调用者可以使用。高位字节指定副版本号;低位字节指定的主版本号。
//初始化套接字
WORD wVersionRequested;
WSADATA WSAData;
wVersionRequested=MAKEWORD(1,1);
WSAStartup(wVersionRequested,&WSAData)
- WSAStartup()
- WSAStartup
- WSAStartup
- WSAStartup
- WSAStartup()
- WSAStartup
- WSAStartup
- WSAStartup
- WSAStartup
- WSAStartup
- WSAStartup函数
- 函数WSAStartup
- 函数WSAStartup
- 函数WSAStartup
- WSAStartup()-注释:
- 函数WSAStartup
- WSAStartup 函数
- WSAStartup函数
- Linux下同时启动两个Tomcat进行设置.
- MultiByteToWideChar和WideCharToMultiByte用法详解
- hdu-3342 Legal or Not
- sencha touch 隐藏滚动条样式的几种方式
- 下载保存文件到手机本地前, 优先选择位置的一个取巧方法
- WSAStartup
- C++学习笔记 面向对象程序设计
- Socket
- Android圆角图片最佳方案
- solr 常见异常
- PyCharm 使用教程
- boost服务器
- Bind
- 面试问题之线程同步和死锁