10057 Socket Error
Contents |
One games Xbox 360 games PC wsa error 10054 games Windows games Windows phone games Entertainment All
Socket Error 10038
Entertainment Movies & TV Music Business & Education Business Students &
Socket Error 10022
educators Developers Sale Sale Find a store Gift cards Products Software & services Windows Office Free downloads & security
Socket Error Code 10061
Internet Explorer Microsoft Edge Skype OneNote OneDrive Microsoft Health MSN Bing Microsoft Groove Microsoft Movies & TV Devices & Xbox All Microsoft devices Microsoft Surface All Windows PCs & tablets PC accessories Xbox & games Microsoft Band Microsoft windows sockets error code 10048 Lumia All Windows phones Microsoft HoloLens For business Cloud Platform Microsoft Azure Microsoft Dynamics Windows for business Office for business Skype for business Surface for business Enterprise solutions Small business solutions Find a solutions provider Volume Licensing For developers & IT pros Develop Windows apps Microsoft Azure MSDN TechNet Visual Studio For students & educators Office for students OneNote in classroom Shop PCs & tablets perfect for students Microsoft in Education Support Sign in Cart Cart Javascript is disabled Please enable javascript and refresh the page Cookies are disabled Please enable cookies and refresh the page CV: {{ getCv() }} English (United States) Terms of use Privacy & cookies Trademarks © 2016 Microsoft
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the windows socket error 10047 workings and policies of this site About Us Learn more about Stack asynchronous socket error 10051 Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions what is a socket error 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 https://support.microsoft.com/en-us/kb/819124 them; it only takes a minute: Sign up Physical disconnection from network and intermittent socket error 10057 up vote 0 down vote favorite A customer of mine has a Windows application where there is a network connection between two machines. The system is supposed to cope with the connection being lost. It does this by keeping a counter on http://stackoverflow.com/questions/30112140/physical-disconnection-from-network-and-intermittent-socket-error-10057 the client position which is reset every time data is received from the server. If the counter reaches 60 seconds (i.e. we haven't heard from the server for 60 seconds) it performs some expected action to cope with the connection being lost. The customer has a problem, however, where sometimes the connection will be lost but the client doesn't perform the expected action. Upon investigation, it appears that this is an intermittent problem caused by the client's socket to the server sometimes raising error 10057 (WSAENOTCONN / "Socket is not connected") when the connection is lost. Because the client behaves differently when it gets a socket error the customer doesn't get the desired behaviour when they get this socket error. This is not difficult for me to fix, but I am a bit puzzled by the different behaviour. To reproduce the problem I'm physically pulling the network cable out of the back of my server machine. The majority of the time, the effect on the client side is that we just don't get any data
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 http://stackoverflow.com/questions/11532311/winsock-send-always-returns-error-10057-in-server 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 minute: Sign up Winsock send() always returns error 10057 socket error in server up vote 2 down vote favorite I'm trying to automate a server request to the client upon connection but I keep getting the WSAGetLastError of 10057. I've set up requests from the client to the server without issues so I don't understand why I cant do the reverse ? Maybe the server must wait for the 1st 'send' from the client but I don't 10057 socket error understand why that could be so ? I'm using: -asynchronous socket -TCP -s is a valid socket -i'v looped RequestInfo for several passes but nothing changes -select() returns 0 -datasize returns -1 with errcode 10057 THANK YOU !!! SERVER: //first - following the debugger FD_ACCEPT int acc = accept(s, (struct sockaddr*)&fromm, &fromlenn); //success if(acc <= 0) { eLOGG << "\nFAIL FD_ACCEPT: " << WSAGetLastError(); } RequestInfo(); //then RequestInfo() { stringstream ssConverter; ssConverter.clear(); ssConverter.str(string()); ssConverter << "00aa"; //request signal bool blogin = false; eLOG << "signal is: *" << ssConverter.str() << "*"; int bufSize = ssConverter.str().length(); fd_set writefds; struct timeval timeout; timeout.tv_sec = 3; timeout.tv_usec = 0; FD_ZERO(&writefds); FD_SET(s, &writefds); int sel = select(s, NULL, &writefds, NULL, &timeout); if(sel == SOCKET_ERROR) { eLOG << "\nselect - read fail: " << WSAGetLastError(); } if(sel == 0) { eLOG << "\nselect - not connected: " << WSAGetLastError(); } if (FD_ISSET(s, &writefds)) { eLOG << "\n FD_ISSET"; } eLOG << "\nauth socket is: " << s; int dataSize = send(s, ssConverter.str().c_str(), bufSize, 0); if(dataSize < bufSize) { eLOG << "\n FD_ISSET"; } //...etc } c++ visual-studio-2010 sockets winsock winsock2 share|improve this question edited Jul 18 '12 at 1:04 Nikolai N