Client idle connection uses onIdleExpired rather than close

This commit is contained in:
Greg Wilkins 2011-11-22 12:57:32 +11:00
parent d55477388b
commit 6cb2d13abd
6 changed files with 3 additions and 39 deletions

View File

@ -439,14 +439,7 @@ public class HttpDestination implements Dumpable
public void returnIdleConnection(AbstractHttpConnection connection)
{
try
{
connection.close();
}
catch (IOException e)
{
LOG.ignore(e);
}
connection.onIdleExpired();
boolean startConnection = false;
synchronized (this)

View File

@ -30,12 +30,4 @@ public class ExternalKeyStoreAsyncSslHttpExchangeTest extends SslHttpExchangeTes
_httpClient = serverAndClientCreator.createClient(3000L,3500L,2000);
_port = _server.getConnectors()[0].getLocalPort();
}
@Override
@Test
public void testBigPostWithContentExchange() throws Exception
{
super.testBigPostWithContentExchange();
}
}

View File

@ -205,8 +205,6 @@ public class ChannelEndPoint implements EndPoint
public void close() throws IOException
{
LOG.debug("close {}",this);
// System.err.println("CLOSE "+_socket);
_channel.close();
}

View File

@ -274,11 +274,11 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
{
long idleTimestamp=_idleTimestamp;
if (!getChannel().isOpen() || idleTimestamp!=0 && _maxIdleTime>0 && now>(idleTimestamp+_maxIdleTime))
idleExpired();
onIdleExpired();
}
/* ------------------------------------------------------------ */
protected void idleExpired()
protected void onIdleExpired()
{
_connection.onIdleExpired();
}

View File

@ -361,7 +361,6 @@ public class SelectChannelEndPointTest
assertEquals(0xff&b0,b);
}
latch.countDown();
Thread.yield();
}
}
catch(ThreadDeath t)

View File

@ -369,24 +369,6 @@ public abstract class AbstractHttpConnection extends AbstractConnection
return _generator.isCommitted();
}
/* ------------------------------------------------------------ */
/**
* @deprecated
*/
public final void scheduleTimeout(Timeout.Task task, long timeoutMs)
{
throw new UnsupportedOperationException();
}
/* ------------------------------------------------------------ */
/**
* @deprecated
*/
public final void cancelTimeout(Timeout.Task task)
{
throw new UnsupportedOperationException();
}
/* ------------------------------------------------------------ */
public void reset()
{