Windows xp tcp socket timeout




















A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing the problem described in this article. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, contact Microsoft Customer Service and Support to obtain the hotfix. Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix.

For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website:. If you do not see your language, it is because a hotfix is not available for that language. For more information about how to obtain a Windows Vista service pack, click the following article number to view the article in the Microsoft Knowledge Base:. The global version of this hotfix installs files that have the attributes that are listed in the following tables.

The dates and the times for these files on your local computer are displayed in your local time together with your current daylight saving time DST bias.

I don't have a Windows machine to confirm, but you should find the respective TCP Keep-Alive settings in the registry at. Applications like Wireshark are able to label it as a "Keep-Alive" packet by meta-analysis of the sequence and acknowledgement numbers it contains in reference to the preceding communications on the socket.

The keep-alive interval is operating system dependent, and may be tuneable via a kernel parameter. To test the latter, you need to implement something that involves sending messages to the server and getting a response. In TCP, the keepalive is the administrative packet sent to detect stale connection. In HTTP, keepalive means the persistent connection state.

Keep-alive packets MUST only be sent when no data or acknowledgement packets have been received for the connection within an interval. As you can see, the default TCP keepalive interval is too long for most applications. You might have to add keepalive in your application protocol. If you're behind a masquerading NAT as most home users are these days , there is a limited pool of external ports, and these must be shared among the TCP connections.

Therefore masquerading NATs tend to assume a connection has been terminated if no data has been sent for a certain time period. This and other such issues anywhere in between the two endpoints can mean the connection will no longer "work" if you try to send data after a reasonble idle period.

However, you may not discover this until you try to send data. Using keepalives both reduces the chance of the connection being interrupted somewhere down the line, and also lets you find out about a broken connection sooner. Here is some supplemental literature on keepalive which explains it in much finer detail. You must follow the pseudo code logic I outlined in this answer on another question :.

You must follow the rules outlined in RFC Do not read any more bytes past that yet. Analyze the received headers, per the rules in RFC Section 4.

They tell you the actual format of the remaining response data. Check the received headers for the presence of a Connection: close header if the response is using HTTP 1. If detected, close your end of the socket connection because the server is closing its end.

Otherwise, keep the connection open and re-use it for subsequent requests unless you are done using the connection, in which case do close it. To do that, you must call recv in a loop until you encounter the terminating CRLF, or have received the expected number of bytes, whichever the case may be.

That doesn't change how you must process the HTTP protocol. What you are encountering is not a Windows bug at all. But an abnormal disconnect may take a long time to detect, so you should implement timeouts in your code instead. In non-blocking mode, you can use select. You can't expect recv to give you any data on a non-blocking socket.

You just need to call recv again normally after select notifies you some data is available. Whether you get data on the first or any call is going to depend on how fast the server is sending it. Today I have changed my software to use blocking sockets. But it still doesn't work on Windows XP. Windows 7 is no problem. So I thought: Let's try another PC. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow.

Learn more. Windows XP socket error with recv Ask Question. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Making Agile work for data science. Stack Gives Back Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually.

Visit chat. Related Hot Network Questions.



0コメント

  • 1000 / 1000