[jdev] Re: XMPP Ping method?

Michal 'vorner' Vaner michal.vaner at kdemail.net
Thu Nov 2 02:21:53 CST 2006

On Wed, Nov 01, 2006 at 10:06:42PM +0100, Tomasz Sterna wrote:
> On 11/1/06, Artur Hefczyc <ajdev at tigase.org> wrote:
> >If 2 machines are connected over TCP/IP connection and there is one
> >or more firewalls in between, try to power-off one of the machines.
> >Another side will not notice connection drop.
> Why not?
> TCP handles disappearing end well.
TCP is designed to discover it can not deliver. Theoretically, if you
turned one machine off, it remembered everything, powered it on again,
the other side might not recognize it at all, if no data flowed.

Silent TCP connection does not send any data.

And, TCP is designed to recognize it can not deliver something
immediately - first machine that can not send the packet would give you
ICMP address unreachable. But, there are many lazy machines which do not
and many hungry firewalls that eat them.

And the problem is, the last data will not be delivered, but the app
inserted it into the socket. They get lost.

TCP handles all nice things, like clean closing, resends.. But if it
dies in an unclean way, you never know how much data the other side
received (well, you can ask the OS to tell you how much data were not
yet acked, but it is much more work to do).

> >Default TCP/IP timeout is 300sec.
> Is there a MUST to use defaults?
No, but you still need to send some data to the connection and that data
will get lost after anyhow short timeout.
> On 11/1/06, Alexander Gnauck <gnauck at ag-software.de> wrote:
> >for some devices it's not. If you work with wireless devices (WLAN, GSM,
> >UMTS) you will see lot's of strange behavior.
> Isn't that broken TCP implementation then?

When eating an elephant take one bite at a time.
		-- Gen. C. Abrams

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.jabber.org/pipermail/jdev/attachments/20061102/0ee84b8e/attachment-0002.pgp>

More information about the JDev mailing list