@Override public void close(final CloseStatus status) { removeSession(this); synchronized (this) { open = false; if (ws != null) { ws.close(status.code(), status.reason()); } } }
private void cleanup(final Throwable cause) { open = false; NativeWebSocket lws = ws; this.ws = null; this.injector = null; this.handler = null; this.closeCallback = null; this.exceptionCallback = null; this.messageCallback = null; if (lws != null && lws.isOpen()) { WebSocket.CloseStatus closeStatus = WebSocket.SERVER_ERROR; if (cause instanceof IllegalArgumentException) { closeStatus = WebSocket.BAD_DATA; } else if (cause instanceof NoSuchElementException) { closeStatus = WebSocket.BAD_DATA; } else if (cause instanceof Err) { Err err = (Err) cause; if (err.statusCode() == 400) { closeStatus = WebSocket.BAD_DATA; } } lws.close(closeStatus.code(), closeStatus.reason()); } }
@Override public void close(final CloseStatus status) { removeSession(this); synchronized (this) { open = false; ws.close(status.code(), status.reason()); } }
private void cleanup(final Throwable cause) { open = false; NativeWebSocket lws = ws; this.ws = null; this.injector = null; this.handler = null; this.closeCallback = null; this.exceptionCallback = null; this.messageCallback = null; if (lws != null && lws.isOpen()) { WebSocket.CloseStatus closeStatus = WebSocket.SERVER_ERROR; if (cause instanceof IllegalArgumentException) { closeStatus = WebSocket.BAD_DATA; } else if (cause instanceof NoSuchElementException) { closeStatus = WebSocket.BAD_DATA; } else if (cause instanceof Err) { Err err = (Err) cause; if (err.statusCode() == 400) { closeStatus = WebSocket.BAD_DATA; } } lws.close(closeStatus.code(), closeStatus.reason()); } }