winsocket
文章平均质量分 66
正经黑天鹅
这个作者很懒,什么都没留下…
展开
-
winsocket c++ 阻塞方式
#include #include #include #pragma comment(lib,"ws2_32.lib")int main(){//加载socket动态库WORD wVersionRequested;WSADATA wsaData;wVersionRequested = MAKEWORD(2,2);auto err = WSAStart原创 2016-08-29 10:33:14 · 701 阅读 · 0 评论 -
winsocket c++ 非阻塞方式
#include #include #include #pragma comment(lib,"ws2_32.lib")int main(){//加载socket动态库WORD wVersionRequested;WSADATA wsaData;wVersionRequested = MAKEWORD(2,2);auto err = WSAStart原创 2016-08-29 11:11:55 · 1804 阅读 · 0 评论 -
winsocket c++ IO复用 之Select
Select对于一个I/O端口,两次调用,两次返回,比阻塞I/O并没有什么优越性,关键是能实现同时对多个IO端口进行监听。#include #include #define PORT 22000#define MSGSIZE 1024#pragma comment(lib, "ws2_32.lib")int g_iTotalConn原创 2016-08-29 15:11:04 · 797 阅读 · 0 评论