当前位置:网站首页>socket demo01
socket demo01
2022-06-26 02:03:00 【Flying fat Da Miao】
socket demo01
#ifdef _WIN64
#include <windows.h>
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#define closesocket close
#endif
#include <stdio.h>
int main(int argc, char* argv[]) {
#ifdef _WIN64
WSADATA ws;
WSAStartup(MAKEWORD(2,2),&ws);
#endif // DEBUG
for (int i = 0; i < 1200; i++) {
int sock = socket(AF_INET, SOCK_STREAM, 0);
if (sock == -1) {
printf("create socket failed!\n");
return -1;
}
printf("socketFd:%d\n", sock);
closesocket(sock);
}
getchar();
return 0;
}
边栏推荐
- 关于VS scanf出现‘scanf‘: This function or variable may be unsafe. Consider usi问题的解决方法
- Tengwenze, a hot-blooded boy, was invited to serve as the image ambassador of the global finals of the sixth season perfect children's model
- 二造实务案例答题技巧和举例汇总,满满都是精髓
- The role of xargs
- 求n的乘阶
- Differences and functions of TOS cos DSCP
- Application and chemical properties of elastase
- Exploring temporary information for dynamic network embedding
- Tcp网络通信中各个状态的含义
- biggan:large scale gan training for high fidelity natural image synthesis
猜你喜欢
jenkins汉化及汉化无效解决方案
如何为政企移动办公加上一道“安全锁”?
shell学习记录(四)
前置++,后置++与前置--与后置--(++a,a++与--a,a--)
recv & send
biggan:large scale gan training for high fidelity natural image synthesis
Distributed systems (II) understanding of distributed transactions
tos cos dscp 区别和作用
A lost note for konjaku beginner
Show spirit chenzitong was invited to be the chief experience officer of the global finals of the sixth season perfect children's model
随机推荐
Pixel6 unlock bootloader
shell学习记录(二)
轻轻松松理解指针
readv & writev
PTA class a simulated first bomb: 1132-1135
shell学习记录(一)
Dataframe to list
标定。。。
How to efficiently complete daily tasks?
Easyexcel read file
The first intimate contact of caching technology
Redis7.0 installation steps
接口测试用例设计
Brief introduction to the usage of iloc in dataframe
一分钟了解同步、异步、阻塞和非阻塞的区别
Differences and functions of TOS cos DSCP
如何使用命令将文件夹中的文件名(包括路径)写入到txt文件中
LeetCode 41 ~ 50
biggan:large scale gan training for high fidelity natural image synthesis
字节序问题