[JDEV] phenomenon associated with frequent connections

Charles Owen owen at addr.com
Wed Oct 3 23:40:31 CDT 2001

Hello all.

I'm hoping you can help explain the following phenomenon. I'm guessing that 
it's well-understood
and easily explained.

Consider this (admittedly pathological) test program:

for ( i = 1 to 10 ) {
     connect to Jabber server;
     pull roster information;
     disconnect from Jabber server;
     sleep; (optional)

If I do not put the thread to sleep at the bottom of the loop, I run into 
trouble on
the sixth iteration -- and the trouble seems to arise consistently on the 
sixth iteration. What
actually happens is that on the sixth pass, I am able to establish a socket 
but as soon as I send an authentication packet, the server sends a TCP FIN 
indicating that it's not going to interact with me anymore. After a few 
seconds, everything
is back to normal.

If on the other hand I put the thread to sleep for a period of time -- a 
few seconds or so --
I never encounter problems; I can connect and disconnect as often as I wish.

Any ideas? I'm using, I belive, version 1.4 hosted on Solaris.

Thanks, Charles.

More information about the JDev mailing list