socket程序在调用recv的时候出10053号

cuigaoyu 2003-12-23 10:36:00
我有个socket程序,和对方通讯,我按照双方的协议发送登陆数据包以及接受登陆的返回包都是ok的,但是程序运行后,在select成功后,调用recv函数会出错,为10053号错误,找了下资料,但是都没有提好的解决方案来避免该错误。

找的资料差不多都如下:
Question/Problem: WSAECONNABORTED (10053) Software caused connection abort.

Answer/Solution: A connection abort was caused internal to your host machine. The software caused a connection abort because there is no space on the socket's queue and the socket cannot receive further connections.

WinSock description: The error can occur when the local network system aborts a connection. This would occur if WinSock aborts an established connection after data retransmission fails (receiver never acknowledges data sent on a datastream socket).

TCP/IP scenario: A connection will timeout if the local system doesn't receive an (ACK)nowledgement for data sent. It would also timeout if a (FIN)ish TCP packet is not ACK'd (and even if the FIN is ACK'd, it will eventually timeout if a FIN is not returned).


WSAECONNABORTED (10053) Software caused connection abort.

Berkeley description: A connection abort was caused internal to your host machine. The software caused a connection abort because there is no space on the socket's queue and the socket cannot receive further connections.

WinSock description: Partly the same as Berkeley. The error can occur when the local network system aborts a connection. This would occur if WinSock aborts an established connection after data retransmission fails (receiver never acknowledges data sent on a datastream socket).

TCP/IP scenario: A connection will timeout if the local system doesn't receive an (ACK)nowledgement for data sent. It would also timeout if a (FIN)ish TCP packet is not ACK'd (and even if the FIN is ACK'd, it will eventually timeout if a FIN is not returned).

User suggestions: There are a number of things to check, that might help to identify why the failure occurred. Basically, you want to identify where the problem occurred.

Ping the remote host you were connected to. If it doesn't respond, it might be off-line or there may be a network problem along the way. If it does respond, then this problem might have been a transient one (so you can reconnect now), or the server application you were connected to might have terminated (so you might not be able to connect again).
Ping a local host to verify that your local network is still functioning (if on a serial connection, see next step)
Ping your local router address. If you're on a serial connection, your local router is the IP address of the host you initially logged onto with SLIP or PPP.
Ping a host on the same subnet as the host you were connected to (if you know one). This will verify that the destination network is functioning.
Try a "traceroute" to the host you were connected to. This won't reveal too much unless you know the router addresses at the remote end, but it might help to identify if the problem is somewhere along the way.
WinSock functions: recv(), recvfrom(), sendto(), FD_CLOSE

Additional functions: send() can also fail with WSAECONNABORTED. Any function that takes a socket as an input parameter--except close socket()--could potentially fail with this error.


不知道大家有什么更好的方案么?
...全文
163 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
tangrh 2003-12-29
  • 打赏
  • 举报
回复
关注
qzexplore 2003-12-26
  • 打赏
  • 举报
回复
关注!!!!
victor_cui 2003-12-23
  • 打赏
  • 举报
回复
呵呵,这个原因是因为对端有一个RST网络事件发生,所以你要检查你的对端程序,一定是发送注册应答后引发了一个非正常的网络操作,你也可以用sniffer等网络抓包工具看看,问题应该出在你的程序上,跟解决方案没有关系!
smallfool 2003-12-23
  • 打赏
  • 举报
回复
最好把代码发上来瞧瞧。
cuigaoyu 2003-12-23
  • 打赏
  • 举报
回复
RST网络事件??能不能说的具体点???

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧