aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-02-27 12:49:44 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-02-27 12:49:44 +1300
commitf3c7e3e6dc28a39f23197beecb2bdac79d6628a3 (patch)
tree067984429fb03cc513f7e99d79d56f33309fd3c9
parent4b2c0d922ba422a696579fa9d083b98da51f6861 (diff)
downloadtrackermap-server-f3c7e3e6dc28a39f23197beecb2bdac79d6628a3.tar.gz
trackermap-server-f3c7e3e6dc28a39f23197beecb2bdac79d6628a3.tar.bz2
trackermap-server-f3c7e3e6dc28a39f23197beecb2bdac79d6628a3.zip
Make WebSocket timeout configurable
-rw-r--r--debug.xml1
-rw-r--r--src/org/traccar/api/AsyncSocketServlet.java3
2 files changed, 3 insertions, 1 deletions
diff --git a/debug.xml b/debug.xml
index 992f586d9..82600a3eb 100644
--- a/debug.xml
+++ b/debug.xml
@@ -14,6 +14,7 @@
<entry key='web.path'>web</entry>
<entry key='web.debug'>true</entry>
<entry key='web.console'>true</entry>
+ <entry key='web.timeout'>10000</entry>
<entry key='geocoder.enable'>true</entry>
<entry key='geocoder.type'>nominatim</entry>
diff --git a/src/org/traccar/api/AsyncSocketServlet.java b/src/org/traccar/api/AsyncSocketServlet.java
index fbfe248e5..edfa8939b 100644
--- a/src/org/traccar/api/AsyncSocketServlet.java
+++ b/src/org/traccar/api/AsyncSocketServlet.java
@@ -20,6 +20,7 @@ import org.eclipse.jetty.websocket.servlet.ServletUpgradeResponse;
import org.eclipse.jetty.websocket.servlet.WebSocketCreator;
import org.eclipse.jetty.websocket.servlet.WebSocketServlet;
import org.eclipse.jetty.websocket.servlet.WebSocketServletFactory;
+import org.traccar.Context;
import org.traccar.api.resource.SessionResource;
public class AsyncSocketServlet extends WebSocketServlet {
@@ -28,7 +29,7 @@ public class AsyncSocketServlet extends WebSocketServlet {
@Override
public void configure(WebSocketServletFactory factory) {
- factory.getPolicy().setIdleTimeout(ASYNC_TIMEOUT);
+ factory.getPolicy().setIdleTimeout(Context.getConfig().getLong("web.timeout", ASYNC_TIMEOUT));
factory.setCreator(new WebSocketCreator() {
@Override
public Object createWebSocket(ServletUpgradeRequest req, ServletUpgradeResponse resp) {