You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Wolter, Johannes - ENCOWAY" <Wo...@encoway.de> on 2007/05/09 15:38:18 UTC

SO_LINGER

Hi,

 

at my company we developed our own servlet-engine/server and experienced
problems, when content was sent through a VPN tunnel. The problem seemed
to be, that on slow networks TCP-connections were cancelled (RST,ACK),
that means not all content written to the socket was sent to the client,
even when we triggered a graceful disconnect (LINGER.l_onoff  == 0 see
http://msdn2.microsoft.com/en-us/library/ms737582.aspx
<http://msdn2.microsoft.com/en-us/library/ms737582.aspx> )

 

We solved the problem by setting linger:

Socket.setSoLinger(100) (Java code)

 

We do not understand why this is necessary, but finally saw, that tomcat
seems to do the same thing. Maybe someone can tell my, why tomcat is
setting SO_LINGER? I found a post from 2002 but it doesn't really
explain, _why_ setSoLinger(100) is necessary. 

http://mail-archives.apache.org/mod_mbox/jakarta-alexandria-dev/200201.m
box/%3C000101c19864$2645ba60$033cc80a%40octovma%3E
<http://mail-archives.apache.org/mod_mbox/jakarta-alexandria-dev/200201.
mbox/%3C000101c19864$2645ba60$033cc80a%40octovma%3E>   

 

Thanks for any hint,

Johannes Wolter

 

 


Re: SO_LINGER

Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Johannes-

enabling SO_LINGER option is a OS directive "dont close this connection when 
data is being transmitted"
Have you found other behaviour either in Microsoft or Unix OS?

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Wolter, Johannes - ENCOWAY" <Wo...@encoway.de>
To: <us...@tomcat.apache.org>
Sent: Wednesday, May 09, 2007 9:38 AM
Subject: SO_LINGER


Hi,



at my company we developed our own servlet-engine/server and experienced
problems, when content was sent through a VPN tunnel. The problem seemed
to be, that on slow networks TCP-connections were cancelled (RST,ACK),
that means not all content written to the socket was sent to the client,
even when we triggered a graceful disconnect (LINGER.l_onoff  == 0 see
http://msdn2.microsoft.com/en-us/library/ms737582.aspx
<http://msdn2.microsoft.com/en-us/library/ms737582.aspx> )



We solved the problem by setting linger:

Socket.setSoLinger(100) (Java code)



We do not understand why this is necessary, but finally saw, that tomcat
seems to do the same thing. Maybe someone can tell my, why tomcat is
setting SO_LINGER? I found a post from 2002 but it doesn't really
explain, _why_ setSoLinger(100) is necessary.

http://mail-archives.apache.org/mod_mbox/jakarta-alexandria-dev/200201.m
box/%3C000101c19864$2645ba60$033cc80a%40octovma%3E
<http://mail-archives.apache.org/mod_mbox/jakarta-alexandria-dev/200201.
mbox/%3C000101c19864$2645ba60$033cc80a%40octovma%3E>



Thanks for any hint,

Johannes Wolter







---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org