views:

85

answers:

3

Once a Tcp/Ip connection has been established between two applications running on the same computer, using the localhost loop back is there any real possibility of losing that connection? Or is it possible to make the assumption that such a connection loss is as rare as a blue screen event, and treat it in a very exceptional manner.

Assuming of course that neither application voluntarily terminates the connection, nor that someone intentionally interfere with the connection.

+4  A: 

It would be an exceptional case indeed, of course a simple DoS attack on the machine could increase the likelyhood.

When a local-local connection like this is lost, there is probably some other looming crisis around the corner (e.g. low memory, change in networking configuration): this might be a symptom of a bigger problem arising.

jldupont
+1  A: 

Yeap,

it's possible. I saw some cases in which the (lmhosts or hosts) file is altered so the localhost entry is altered to some other address.

If some application try to access localhost, it will actually be redirected to another address and, as a consequence, will not be able to create or maintain a connection.

EDIT: as mentioned by bmargulies, existing connections will not be closed, but new ones will have the problem I showed above.

Kico Lobo
No way will changing the text file mapping hosts to addresses disturb an existing connection. It will indeed mess up new attempts.
bmargulies
@Kico Lobo -- Hey, you have to edit more than 5 minutes after the original posting for me to remove the downvote. http://meta.stackoverflow.com/questions/23701/why-cant-i-change-my-vote-if-the-post-has-been-edited-during-the-initial-5mn-gr
bmargulies
Ops! I'm new here. Didn't know that. Sorry.
Kico Lobo
+2  A: 

It'll most likely always work.

The loopback is part of your OS, just as the COM framework is too, or the shell-API, or the task scheduler. Of course things can go wrong. The RPC service can crash and the virtual adapter driver as well, leaving you stranded. But that is most likely due to serious issues in other fields (low memory, environment changes, hardware failures an such).

You need to be able to depend on something.

~Rob

Rob Vermeulen