public static class ClientManager.ReconnectHandler extends Object
Session.close()
call will be treated just like any other disconnect resulting in reconnect.Constructor and Description |
---|
ReconnectHandler() |
Modifier and Type | Method and Description |
---|---|
long |
getDelay()
Get reconnect delay.
|
boolean |
onConnectFailure(Exception exception)
Called when there is a connection failure.
|
boolean |
onDisconnect(javax.websocket.CloseReason closeReason)
Called after
OnClose annotated method (or Endpoint.onClose(javax.websocket.Session, javax.websocket.CloseReason) is invoked. |
public boolean onDisconnect(javax.websocket.CloseReason closeReason)
OnClose
annotated method (or Endpoint.onClose(javax.websocket.Session, javax.websocket.CloseReason)
is invoked.closeReason
- close reason passed to onClose method.true
is returned, client container will reconnect.public boolean onConnectFailure(Exception exception)
Exception
parameter. Be cautious when implementing this method,
you might easily cause DDoS like behaviour.exception
- Exception thrown during connection phase.true
is returned, client container will reconnect.public long getDelay()
onDisconnect(CloseReason)
or onConnectFailure(Exception)
when true
is
returned. When positive value is returned, next connection attempt will be made after that number of
seconds.
Default implementation returns .Copyright © 2012-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.