KeepAlive settings for an Azure VM The same fix can be applied to Worker Roles, by running the tTcpKeepAlive (bool enabled, int keepAliveTime, int keepAliveInterval) command in the OnStart method of your worker role.
Remember that after changing these settings, youll kof 98 hack rom need to reboot the machine (its Windows after all).
Martin Rhodes - Developer @ Felinesoft.
After 10 unanswered retransmissions, the connection will be aborted.
A while back, I started work on an idea based around an Azure worker role that connects to an IRC (Internet Relay Chat) server as a chat bot, and sits in chat channels recording the words in messages to a backend database (for those who.To solve this problem, you will need to tweak a few Windows network settings.You can add it by editing the registry or by using a program that edits the registry.Having a high KeepAliveTime brings two problems: it may cause a delay before the machine at one end of the connection detects that the remote machine is no longer available many firewalls drop the session if no traffic occurs for a given amount of time.TCP KeepAlives ; small data packets which are periodically sent to the server to let the client and server know that they are still connected, even though they are not exchanging any real data.But you can change the KeepAliveTime in the registry to a more practical time (for todays comms - as you have found out timeout way before that heres how (from: m/kb/120642 In: tcpipParameters Adapter NameParametersTcpip, optional parameters configurable using Registry Editor.If you encounter one of these cases on a regular basis, you should consider reducing the KeepAliveTime from 2 hours to 10 or 15 minutes (i.e.
IRC does have a mechanism for this built into the IRC protocol - ping, which can be used to measure lag between client and server but if you are in a situation where you do not have control over the IRC clients behaviour, and there.
TcpMaxDataRetransmissions, decimal 8 Setting decimal values for a dword key Once I had done this and restarted the VM, the connection no longer disconnected after 4 minutes of inactivity.
If at some point in time the remote hosts responds to the keep-alive packet, the next keep-alive packet will be again sent based on the KeepAliveTime parameter (assuming the connection is still idle).
This means that, when TCP KeepAlive is turned on for a certain socket at the OS-Level, Windows will only send out a KeepAlive packet after 2 hours, but Azure will disconnect you after only 4 minutes of inactivity.As IRC is designed cuba lonely planet pdf to stay connected for long periods of time without the guarantee of traffic across the network, this seemed to rule out the client or server.Setting the KeepAlive interval to something below 4 minutes is all that is needed to thwart Azure's inbuilt connection culling, and requires the addition of 3 new registry keys under ServicesTcpipParameters: KeepAliveTime the amount of time a connection is idle for before the OS will.TCP sends keep-alive transmissions to verify that an idle connection is still active.If the remote system is still reachable and functioning, it will acknowledge the keep alive transmission.