socket程序在调用recv的时候出10053号
我有个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.
不知道大家有什么更好的方案么?