I have just realized after doing some testing that socket connections with both ends pointing to local (127.0.0.1) are not being affected by the keep-alive timeout after two hours set by default on Windows Server 2008 R2. I did not find any docs explaining this. Can anyone give me some information about why this happens?
Asked
Active
Viewed 760 times
1 Answers
0
There should be no keep-alive needed on local TCP sockets, because the OS has control over both sides of the connection and notices if one goes away. Keep-alive is only needed to remote systems. Maybe you mean timeout and not keep-alive?

Steffen Ullrich
- 114,247
- 10
- 131
- 172
-
That makes sense. Yes, I was wondering if a local-to-local socket connection is closed after the default time of inactivity set by Windows (I think is two hours). – ChrisPeterson May 16 '14 at 14:09
-
1Keep-alive is for detecting lost connectivity, not inactivity. At least on the local machine there is no inherent inactivity timeout, with remote systems you might get something like this if firewalls or NAT-router are involved, which set a inactivity timeout for a connection state they maintain. You might set a timeout for read (SO_TIMEOUT) but if both sides just idle without trying to read you will not get any timeouts. – Steffen Ullrich May 16 '14 at 15:41