diff options
-rw-r--r-- | src/main/java/org/openslx/imagemaster/thrift/server/BinaryListener.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/imagemaster/thrift/server/BinaryListener.java b/src/main/java/org/openslx/imagemaster/thrift/server/BinaryListener.java index 7c20202..bd11d68 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/server/BinaryListener.java +++ b/src/main/java/org/openslx/imagemaster/thrift/server/BinaryListener.java @@ -27,6 +27,12 @@ public class BinaryListener implements Runnable { private static final int MAX_MSG_LEN = 30 * 1000 * 1000; + /** + * How long a client connection can be idle before we close it to free up resources. + * Keep this a bit higher than the timeout client-side... + */ + private static final int CLIENT_TIMEOUT_MS = 120_000; + private final MasterServer.Processor<MasterServerHandler> processor = new MasterServer.Processor<MasterServerHandler>( new MasterServerHandler() ); final TProtocolFactory protFactory = new TBinaryProtocolSafe.Factory( true, true ); @@ -70,7 +76,7 @@ public class BinaryListener implements Runnable params.setKeyStore( Globals.getSslKeystoreFile(), Globals.getSslKeystorePassword() ); TServerTransport serverTransport; try { - serverTransport = TSSLTransportFactory.getServerSocket( port, 0, null, params ); + serverTransport = TSSLTransportFactory.getServerSocket( port, CLIENT_TIMEOUT_MS, null, params ); } catch ( TTransportException e ) { log.fatal( "Could not listen on port " + port ); throw e; |