@Override public void onContinuationFrame(ByteBuffer buffer, boolean fin) throws IOException { if (activeMessage == null) { throw new IOException("Out of order Continuation frame encountered"); } appendMessage(buffer,fin); }
private void unhandled(Throwable t) { TARGET_LOG.warn("Unhandled Error (closing connection)",t); onError(t); if (t instanceof CloseException) { terminateConnection(((CloseException)t).getStatusCode(),t.getClass().getSimpleName()); return; } // Unhandled Error, close the connection. switch (policy.getBehavior()) { case SERVER: terminateConnection(StatusCode.SERVER_ERROR,t.getClass().getSimpleName()); break; case CLIENT: terminateConnection(StatusCode.POLICY_VIOLATION,t.getClass().getSimpleName()); break; } } }
onFrame(frame); onPing(frame.getPayload()); session.getRemote().sendPong(pongBuf); break; onPong(frame.getPayload()); break; onBinaryFrame(frame.getPayload(),frame.isFin()); return; onTextFrame(frame.getPayload(),frame.isFin()); return; onContinuationFrame(frame.getPayload(),frame.isFin()); return; terminateConnection(StatusCode.BAD_PAYLOAD,e.getMessage()); terminateConnection(e.getStatusCode(),e.getMessage()); unhandled(t);
@Override public final void incomingError(Throwable e) { if (LOG.isDebugEnabled()) { LOG.debug("incomingError(" + e.getClass().getName() + ")",e); } onError(e); }
@Override public void openSession(WebSocketSession session) { if (LOG.isDebugEnabled()) { LOG.debug("openSession({})", session); LOG.debug("objectFactory={}", session.getContainerScope().getObjectFactory()); } this.session = session; this.session.getContainerScope().getObjectFactory().decorate(this.websocket); try { this.onConnect(); } catch (Throwable t) { this.session.notifyError(t); throw t; } }