标题:bind的时候出问题,错误码是 10049
取消只看楼主
丙丙
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-10-7
 问题点数:0 回复次数:0 
bind的时候出问题,错误码是 10049

bind的时候出问题,错误码是 10049 哪位大哥给个原因 void SendFile(void) { SOCKET s; CSrchDir sd; ifstream fin; struct sockaddr_in name;//={INADDR_ANY, PORT, AF_INET}; char path[MAX_PATH],databuf[LENGTH]; int n,i; WSADATA wsd; WORD wVersionRequested=MAKEWORD(2,2); char sip[16];

name.sin_family=AF_INET; name.sin_port=PORT;

cout<<"input embracer's IP :\n "; cin>>sip; name.sin_addr.s_addr=inet_addr(sip);

if(WSAStartup(wVersionRequested, &wsd)!=0) return;

s = socket(AF_INET, SOCK_STREAM, 0);

if(bind(s, (struct sockaddr*)&name, sizeof(struct sockaddr))!=0){ i=WSAGetLastError(); cout<<i<<endl; return; }

if(connect(s, (struct sockaddr*)&name, sizeof(struct sockaddr))!=0) return; ……

搜索更多相关主题的帖子: bind 
2005-10-07 15:29



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-29495-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.208754 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved