You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by vichi <vi...@gmail.com> on 2009/11/12 17:47:21 UTC

setServerSoTimeout(int ) and setSoTimeout(int ) functionality

1) can any one elaborate me the functionality of methods
setServerSoTimeout(int ) and setSoTimeout(int ) of
org.apache.coyote.http11.Http11BaseProtocol class.
2) if i set setSoTimeout(2000 ) then will socket be closed after 2000
milliseconds. 

I am using Tomcat 5.5.23 src for my embedded tomcat server.

please need our immediate help.

Thanks,
-vichi
-- 
View this message in context: http://old.nabble.com/setServerSoTimeout%28int-%29-and-setSoTimeout%28int-%29-functionality-tp26322108p26322108.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: setServerSoTimeout(int ) and setSoTimeout(int ) functionality

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Vichi,

On 11/12/2009 12:45 PM, vichi wrote:
> Hey Mark, many many thanks for your crystal clear clarification for
> setSoTimeout(int ). is same concept applies for setServerSoTimeout(int ) or
> it there for some other purpose.

Check the javadocs for java.net.Socket.setSoTimeout:
http://java.sun.com/j2se/1.5.0/docs/api/java/net/Socket.html#setSoTimeout(int)

and java.net.ServerSocket.setSoTimeout:
http://java.sun.com/j2se/1.5.0/docs/api/java/net/ServerSocket.html#setSoTimeout(int)

The only confusing part of the javadocs for these methods is "The
timeout must be > 0" followed by a description of what happens when the
timeout parameter is equal to zero making it clear that the timeout
parameter may, in fact, be zero.

I would imagine that the methods in Http11BaseProtocol map directly to
calls to these methods.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr9ukgACgkQ9CaO5/Lv0PCS1gCfdMucH/1U/v/QhSX+d9II4Pqk
kQgAn0pwwl/l2C1pBIxkQIGkbnpSJf47
=SNHE
-----END PGP SIGNATURE-----

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


Re: setServerSoTimeout(int ) and setSoTimeout(int ) functionality

Posted by vichi <vi...@gmail.com>.
Hey Mark, many many thanks for your crystal clear clarification for
setSoTimeout(int ). is same concept applies for setServerSoTimeout(int ) or
it there for some other purpose.

thanks,
-Vichi



Mark Thomas wrote:
> 
> vichi wrote:
>> 1) can any one elaborate me the functionality of methods
>> setServerSoTimeout(int ) and setSoTimeout(int ) of
>> org.apache.coyote.http11.Http11BaseProtocol class.
>> 2) if i set setSoTimeout(2000 ) then will socket be closed after 2000
>> milliseconds. 
> 
> It depends. Timeouts only apply when Tomcat is using the socket. If Tomcat
> is
> busy doing something else (eg processing a servlet to generate a response)
> then
> it won't be trying to read/write to the socket so the timeout won't apply.
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/setServerSoTimeout%28int-%29-and-setSoTimeout%28int-%29-functionality-tp26322108p26323083.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: setServerSoTimeout(int ) and setSoTimeout(int ) functionality

Posted by Mark Thomas <ma...@apache.org>.
vichi wrote:
> 1) can any one elaborate me the functionality of methods
> setServerSoTimeout(int ) and setSoTimeout(int ) of
> org.apache.coyote.http11.Http11BaseProtocol class.
> 2) if i set setSoTimeout(2000 ) then will socket be closed after 2000
> milliseconds. 

It depends. Timeouts only apply when Tomcat is using the socket. If Tomcat is
busy doing something else (eg processing a servlet to generate a response) then
it won't be trying to read/write to the socket so the timeout won't apply.

Mark


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