Error 10054 Winsock Error In Recv
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow
Windows Socket Error 10054
the company Business Learn more about hiring developers or posting ads with us Stack socket error 10054 connection reset by peer Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of
Wsaeconnreset 10054
4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up socket error 10054 up vote 2 down vote favorite I have a C/S program. Client use socket to https://support.microsoft.com/en-us/kb/981344 send a file to server, after send approximate more than 700k data, client(on win7) will receive a socket 10054 error which means Connection reset by peer. Server worked on CentOS 5.4, client is windows7 virtual machine run in virtual box. client and server communicate via a virtual network interface. The command port(send log) is normal, but the data port(send file) have the problem. If it was caused by wrong configuration of socket http://stackoverflow.com/questions/8558738/socket-error-10054 buffer size or something else? If anyone can help me check the problem. Thanks. Every time I call socket send a buffer equals 4096 byte send(socket, buffer, 4096, 0 ) CentOS socket config. #sysctl -a ... net.ipv4.tcp_rmem = 4096 87380 4194304 net.ipv4.tcp_wmem = 4096 16384 4194304 net.ipv4.tcp_mem = 196608 262144 393216 net.ipv4.tcp_dsack = 1 net.ipv4.tcp_ecn = 0 net.ipv4.tcp_reordering = 3 net.ipv4.tcp_fack = 1 I'm not quite understand what the socket buffer configuration means, if this will cause the receive incomplete result problem? sockets windows-7 centos virtualbox share|improve this question asked Dec 19 '11 at 8:28 jerry.liu 200238 The most likely cause of "connection reset by peer" is the program on the other side crashing. –David Schwartz Dec 19 '11 at 8:32 @David Schwartz, server seams normal and the socket are not closed, finally, got recv time out error. –jerry.liu Dec 19 '11 at 8:34 Receive time out? TCP doesn't normally have a receive time out. Is that your own code? What do you do when you think a receive timed out? And are you 100% sure the client got the connection reset by peer before the server got the receive time out? (If it's the other way around, it's a bug in your code. Each side is waiting
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies http://stackoverflow.com/questions/10997221/irregular-socket-errors-10054-on-windows-application of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a error 10054 minute: Sign up Irregular socket errors (10054) on Windows application up vote 1 down vote favorite 1 I am working on a Windows (Microsoft Visual C++ 2005) application that uses several processes running on different hosts in an intranet. Processes communicate with each other using TCP/IP. Different processes can be on the same host or on different hosts (i.e. the communication can winsock error 10054 be both within the same host or between different hosts). We have currently a bug that appears irregularly. The communication seems to work for a while, then it stops working. Then it works again for some time. When the communication does not work, we get an error (apparently while a process was trying to send data). The call looks like this: send(socket, (char *) data, (int) data_size, 0); By inspecting the error code we get from WSAGetLastError() we see that it is an error 10054. Here is what I found in the Microsoft documentation (see here): WSAECONNRESET 10054 Connection reset by peer. An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in pr