/** * Is called if the underlying connection was closed from the remote side. * Won't be called if the user issues the close, since the client will then move * to the {@link WaitingForDisconnectState} directly. * @param closeReason An optional reason why the connection closed. */ void onConnectionClosed(Throwable closeReason) { if (currentState instanceof SessionEstablishedState) ((SessionEstablishedState)currentState).onConnectionClosed(closeReason); else if (currentState instanceof HandshakingState) ((HandshakingState)currentState).onConnectionClosed(closeReason); }
/** * Is called if the underlying connection was closed from the remote side. * Won't be called if the user issues the close, since the client will then move * to the {@link WaitingForDisconnectState} directly. * @param closeReason An optional reason why the connection closed. */ void onConnectionClosed(Throwable closeReason) { if (currentState instanceof SessionEstablishedState) ((SessionEstablishedState)currentState).onConnectionClosed(closeReason); else if (currentState instanceof HandshakingState) ((HandshakingState)currentState).onConnectionClosed(closeReason); }