@Override public void close(int statusCode, String reason) { CloseInfo close = new CloseInfo(statusCode,reason); // TODO: disconnect callback? outgoingFrame(close.asFrame(),null); }
@Override public void close(int statusCode, String reason) { CloseInfo close = new CloseInfo(statusCode,reason); // TODO: disconnect callback? outgoingFrame(close.asFrame(),null); }
/** * CLOSE Primary Entry Point. * * <ul> * <li>atomically enqueue CLOSE frame + flip flag to reject more frames</li> * <li>setup CLOSE frame callback: must close flusher</li> * </ul> * * @param closeInfo the close details */ private void close(CloseInfo closeInfo, Callback callback) { if (LOG.isDebugEnabled()) LOG.debug("close({})", closeInfo); if (closed.compareAndSet(false, true)) { CloseFrame frame = closeInfo.asFrame(); connection.outgoingFrame(frame, new OnCloseLocalCallback(callback, connection, closeInfo), BatchMode.OFF); } }
/** * Enqueue a close frame. * * @param statusCode * the WebSocket status code. * @param reason * the (optional) reason string. (null is allowed) * @see StatusCode */ private void enqueClose(int statusCode, String reason) { synchronized (writeBytes) { // It is possible to get close events from many different sources. // Make sure we only sent 1 over the network. if (writeBytes.isClosed()) { // already sent the close return; } } CloseInfo close = new CloseInfo(statusCode,reason); // TODO: create DisconnectCallback? outgoingFrame(close.asFrame(),new OnCloseCallback()); }
/** * Enqueue a close frame. * * @param statusCode * the WebSocket status code. * @param reason * the (optional) reason string. (null is allowed) * @see StatusCode */ private void enqueClose(int statusCode, String reason) { synchronized (writeBytes) { // It is possible to get close events from many different sources. // Make sure we only sent 1 over the network. if (writeBytes.isClosed()) { // already sent the close return; } } CloseInfo close = new CloseInfo(statusCode,reason); // TODO: create DisconnectCallback? outgoingFrame(close.asFrame(),new OnCloseCallback()); }