Package io.undertow.websockets.jsr
Interface WebSocketReconnectHandler
public interface WebSocketReconnectHandler
A reconnect handler for web socket connections. If a websocket is reconnected it will re-use the same web socket
endpoint instance.
Note that only a single reconnect handler instance can be registered for each deployment. If a reconnect handler
wishes to save state it should store it in the session attributes
- Author:
- Stuart Douglas
-
Method Summary
Modifier and TypeMethodDescriptionlong
disconnected
(javax.websocket.CloseReason closeReason, URI connectionUri, javax.websocket.Session session, int disconnectCount) Method that is invoked by the reconnect handler after disconnectionlong
reconnectFailed
(IOException exception, URI connectionUri, javax.websocket.Session session, int failedCount) Method that is invoked if the reconnection fails
-
Method Details
-
disconnected
long disconnected(javax.websocket.CloseReason closeReason, URI connectionUri, javax.websocket.Session session, int disconnectCount) Method that is invoked by the reconnect handler after disconnection- Parameters:
closeReason
- The close reason- Returns:
- The number of milliseconds to wait for a reconnect, or -1 if no reconnect should be attempted
-
reconnectFailed
long reconnectFailed(IOException exception, URI connectionUri, javax.websocket.Session session, int failedCount) Method that is invoked if the reconnection fails- Parameters:
exception
- The failure exception- Returns:
- The number of milliseconds to wait for a reconnect, or -1 if no reconnect should be attempted
-