Issue #207 - Using connection idle-timeout declared in annotation

This commit is contained in:
Joakim Erdfelt 2016-10-12 11:14:15 -07:00
parent 0e9841a3cc
commit 512e0ec076
3 changed files with 8 additions and 2 deletions

View File

@ -177,6 +177,8 @@ public class WebSocketSession extends ContainerLifeCycle implements Session, Rem
addManaged(this.endpointFunctions);
super.doStart();
connection.setMaxIdleTimeout(this.policy.getIdleTimeout());
}
@Override

View File

@ -730,7 +730,10 @@ public abstract class AbstractWebSocketConnection extends AbstractConnection imp
@Override
public void setMaxIdleTimeout(long ms)
{
getEndPoint().setIdleTimeout(ms);
if(ms >= 0)
{
getEndPoint().setIdleTimeout(ms);
}
}
@Override

View File

@ -88,7 +88,8 @@ public class IdleTimeoutTest
client.expectUpgradeResponse();
// This wait should be shorter than client timeout above, but
// longer than server timeout configured in TimeoutServlet
// longer than server timeout configured in FastTimeoutRFCSocket
// eg: websocket server endpoint timeout < this timeout < websocket client idle timeout
client.sleep(TimeUnit.MILLISECONDS,1000);
// Write to server