用socket send数据成功,但是在recv卡住了,是不是我代码有问题
1个回答
展开全部
初始化我的套接字:
C/C++ code?
1
2
3
4
5
6
pURL = gethostbyname("www.abc.com");
WSAStartup(MAKEWORD(2,2), &WSAData);
sockfd = socket(PF_INET, SOCK_STREAM, 0);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = *((unsigned long*)pURL->h_addr);
addr.sin_port = htons(80);
连接:
C/C++ code?
1
connect(sockfd,(SOCKADDR *)&addr,sizeof(addr));
C/C++ code?
1
2
3
4
5
6
pURL = gethostbyname("www.abc.com");
WSAStartup(MAKEWORD(2,2), &WSAData);
sockfd = socket(PF_INET, SOCK_STREAM, 0);
addr.sin_family = AF_INET;
addr.sin_addr.s_addr = *((unsigned long*)pURL->h_addr);
addr.sin_port = htons(80);
连接:
C/C++ code?
1
connect(sockfd,(SOCKADDR *)&addr,sizeof(addr));
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询