summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-05-26 03:03:38 (EDT)
committerEike Stepper2008-05-26 03:03:38 (EDT)
commitaf248df935fefa09d4347b661e607b8ad985a3cf (patch)
tree57603ca32ae3ca3cd8ad8c06fe08d8984a712669
parent5d5b1e471989afdece69794bdb85ca0f2b0087fb (diff)
downloadcdo-af248df935fefa09d4347b661e607b8ad985a3cf.zip
cdo-af248df935fefa09d4347b661e607b8ad985a3cf.tar.gz
cdo-af248df935fefa09d4347b661e607b8ad985a3cf.tar.bz2
[232648] Provide an HTTPConnector
https://bugs.eclipse.org/bugs/show_bug.cgi?id=232648
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptor.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptor.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptor.java
index aeb9772..4f0aaa3 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptor.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPAcceptor.java
@@ -25,6 +25,7 @@ import org.eclipse.internal.net4j.channel.InternalChannel;
import org.eclipse.internal.net4j.connector.Connector;
import java.util.ArrayList;
+import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -36,7 +37,7 @@ public class HTTPAcceptor extends Acceptor implements IHTTPAcceptor, INet4jTrans
{
public static final int DEFAULT_CONNECTOR_ID_LENGTH = 32;
- public static final int DEFAULT_MAX_IDLE_TIME = 10000;
+ public static final int DEFAULT_MAX_IDLE_TIME = 10 * 60 * 1000; // 10 minutes
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG, HTTPAcceptor.class);
@@ -142,6 +143,7 @@ public class HTTPAcceptor extends Acceptor implements IHTTPAcceptor, INet4jTrans
connector.setConnectorID(connectorID);
connector.setUserID(userID);
addConnector(connector);
+ connector.activate();
return connectorID;
}
@@ -231,7 +233,13 @@ public class HTTPAcceptor extends Acceptor implements IHTTPAcceptor, INet4jTrans
protected int cleanIdleConnectors()
{
long now = System.currentTimeMillis();
- for (IConnector connector : getAcceptedConnectors())
+ IConnector[] connectors = getAcceptedConnectors();
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Checking {0} HTTP server connectors for idle time: {1,time}", connectors.length, new Date());
+ }
+
+ for (IConnector connector : connectors)
{
HTTPServerConnector serverConnector = (HTTPServerConnector)connector;
long lastTraffic = serverConnector.getLastTraffic();