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 fa635f5ecd
commit 3a37386ae9
3 changed files with 8 additions and 2 deletions

View File

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

View File

@ -732,9 +732,12 @@ public abstract class AbstractWebSocketConnection extends AbstractConnection imp
@Override
public void setMaxIdleTimeout(long ms)
{
if(ms >= 0)
{
getEndPoint().setIdleTimeout(ms);
}
}
@Override
public SuspendToken suspend()

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