当前位置:网站首页>socket demo01
socket demo01
2022-06-26 00:26:00 【会飞的胖达喵】
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;
}
边栏推荐
- 清甜女孩李斯霞 受邀担任第六季完美童模全球总决赛小主持人
- JQ user defined attribute value
- 字节序问题
- Dataframe extracts data from a column and converts it into a list
- GUN make (4) 规则的命令
- Abnova CMV CISH probe solution
- V4L2+QT视频优化策略
- 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
- Chemical properties and application of trypsin
- Show spirit chenzitong was invited to be the chief experience officer of the global finals of the sixth season perfect children's model
猜你喜欢
元气少女王钰洁 受邀担任第六季完美童模全球总决赛代言人
Interpretation of script corresponding to postman assertion
阳光男孩陈颢天 受邀担任第六季完美童模全球总决赛代言人
关于VS scanf出现‘scanf‘: This function or variable may be unsafe. Consider usi问题的解决方法
Pixel6 unlock bootloader
Wanglaoji pharmaceutical's public welfare activity of "caring for the most lovely people under the scorching sun" was launched in Hangzhou
Talking about interface test (I)
王老吉药业“关爱烈日下最可爱的人”公益活动在杭启动
recvmsg & sendmsg
甜酷少女金书伊 受邀担任第六季完美童模全球总决赛代言人
随机推荐
How to add a "security lock" to the mobile office of government and enterprises?
tos cos dscp 区别和作用
jenkins汉化及汉化无效解决方案
Several methods of JQ obtaining objects
On the difference between strlen and sizeof
wifi 相关知识详解
缓存技术之第一次亲密接触
Introduction to gun make (1)
Chinese and English instructions of collagen enzyme Worthington
Easyexcel read file
Data analysis - similarities and differences between C-end and b-end data analysis
Redis-SDS
PTA class a simulated second bullet: 1136-1139
记录一个诡异的图片上传问题
PTA class a simulated third bomb: 1140-1143
Redis7.0 installation steps
Dataframe extracts data from a column and converts it into a list
Is the securities account recommended by qiniu safe?
cyclegan:unpaired image-to-image translation using cycle-consistent adversarial network
前置++,后置++与前置--与后置--(++a,a++与--a,a--)