improved low resource handling

git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@158 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
Greg Wilkins 2009-04-17 02:37:34 +00:00
parent 868f248eae
commit a6d2ce42f6
1 changed files with 5 additions and 4 deletions

View File

@ -122,10 +122,11 @@ public class SocketConnector extends AbstractConnector
throws IOException
{
Connection connection = (Connection)endpoint;
if (connection._sotimeout!=_maxIdleTime)
int lrmit = isLowResources()?_lowResourceMaxIdleTime:_maxIdleTime;
if (connection._sotimeout!=lrmit)
{
connection._sotimeout=_maxIdleTime;
((Socket)endpoint.getTransport()).setSoTimeout(_maxIdleTime);
connection._sotimeout=lrmit;
((Socket)endpoint.getTransport()).setSoTimeout(lrmit);
}
super.customize(endpoint, request);
@ -220,7 +221,7 @@ public class SocketConnector extends AbstractConnector
{
if (_connection.isIdle())
{
if (getServer().getThreadPool().isLowOnThreads())
if (isLowResources())
{
int lrmit = getLowResourceMaxIdleTime();
if (lrmit>=0 && _sotimeout!= lrmit)