关于WinSocket的10048错误问题!(100分)

  • 主题发起人 主题发起人 shuoshuo
  • 开始时间 开始时间
S

shuoshuo

Unregistered / Unconfirmed
GUEST, unregistred user!
我写了一个Socket服务端程序,里面用到了ServerSocket控件,为什麽我的程序放到某些
机器上启动时就会报错!Windows Socket error!on API 'bind'!
然后自动退出!请问为什麽会出现这个错误?怎样解决!
 
是不是socket dll的版本不对?
Wsock32.dll也copy一下试试
 
important ﹕other socket don't open which serversocket default connection ,
for example:clientsocket1(202.103.12.1)------------serversocket1(202.103.12.3)
if you moved the serversocket1 run in (202.103.12.4)then
raise expect'window socket error﹗on api 'bind'!
recommendation:don' t hold the releation each other on ipaddress low
 
是不是你的其他程序已经使用了那个端口?
(比如你的机运行了IIS,打开了80端口,你又再使用80端口?)
 
bind的端口错了。如pipi述
 
绑定端口时出错,在运行你的程序之前,检查一下你用的端口是不是已被别的程序占用?
用netstat命令,解决办法,使用一个端口号大的端口,比如9999等...
 
是绑定端口出错,你的错误号是10048,在dos窗口下输入net helpmsg 10048
可以看到错误说明。

改变一下你的端口,用netstat可以看到你的机器上已经使用了的端口。
 
The following error codes apply to the <big>WinSock ActiveX Controls</big>.

<b>Error Code Error Message</b>
10004 The operation is canceled.
10013 The requested address is a broadcast address, but flag is not set.
10014 Invalid argument.
10022 Socket not bound, invalid address or listen is not invoked prior to accept.
10024 No more file descriptors are available, accept queue is empty.
10035 Socket is non-blocking and the specified operation will block.
10036 A blocking Winsock operation is in progress.
10037 The operation is completed. No blocking operation is in progress.
10038 The descriptor is not a socket.
10039 Destination address is required.
10040 The datagram is too large to fit into the buffer and is truncated.
10041 The specified port is the wrong type for this socket.
10042 Option unknown, or unsupported.
10043 The specified port is not supported.
10044 Socket type not supported in this address family.
10045 Socket is not a type that supports connection oriented service.
10047 Address Family is not supported.
10048 Address in use.
10049 Address is not available from the local machine.
10050 Network subsystem failed.
10051 The network cannot be reached from this host at this time.
10052 Connection has timed out when SO_KEEPALIVE is set.
10053 Connection is aborted due to timeout or other failure.
10054 The connection is reset by remote side.
10055 No buffer space is available.
10056 Socket is already connected.
10057 Socket is not connected.
10058 Socket has been shut down.
10060 The attempt to connect timed out.
10061 Connection is forcefully rejected.
10201 Socket already created for this object.
10202 Socket has not been created for this object.
11001 Authoritative answer: Host not found.
11002 Non-Authoritative answer: Host not found.
11003 Non-recoverable errors.
11004 Valid name, no data record of requested type.
 
端口被占用了,根据柏克利套接字的定义,在初始化一个socket以后,要进行绑定(bind)
如果端口被占用了,就会发生错误。
 
shuoshuo:如果你还要继续讨论请定期提前你的帖子,如果不想继续讨论请结束帖子。
请认真阅读大富翁论坛规则说明 http://www.delphibbs.com/delphibbs/rules.htm
 
多人接受答案了。
 
后退
顶部