@Override public void setNextIncomingFrames(IncomingFrames incoming) { getParser().setIncomingFramesHandler(incoming); } }
public void configure(Parser parser) { parser.configureFromExtensions(extensions); }
while (parseFrame(buffer)) notifyFrame(frame); if (frame.isDataFrame() && frame.isFin()) notifyWebSocketException(e); notifyWebSocketException(new WebSocketException(t));
while (parseFrame(buffer)) notifyFrame(frame); if (frame.isDataFrame()) reset(); reset(); reset();
if (isRsv1InUse()) frame.setRsv1(true); else if (isRsv2InUse()) frame.setRsv2(true); else if (isRsv3InUse()) frame.setRsv3(true); else assertSanePayloadLength(payloadLength); if (frame.isMasked()) if (cursor == 0) assertSanePayloadLength(payloadLength); if (frame.isMasked()) if (parsePayload(buffer))
assertSanePayloadLength(payloadLength); if (frame.isMasked()) if (cursor == 0) assertSanePayloadLength(payloadLength); if (frame.isMasked()) if (parsePayload(buffer))
@Override public void onOpen() { boolean beenOpened = opened.getAndSet(true); if (!beenOpened) { WebSocketSession session = getSession(); ConnectionManager connectionManager = connectPromise.getClient().getConnectionManager(); connectionManager.addSession(session); connectPromise.succeeded(session); ByteBuffer extraBuf = connectPromise.getResponse().getRemainingBuffer(); if (extraBuf.hasRemaining()) { LOG.debug("Parsing extra remaining buffer from UpgradeConnection"); getParser().parse(extraBuf); } } super.onOpen(); }
public AbstractWebSocketConnection(EndPoint endp, Executor executor, Scheduler scheduler, WebSocketPolicy policy, ByteBufferPool bufferPool) { super(endp,executor); this.id = Long.toString(ID_GEN.incrementAndGet()); this.policy = policy; this.bufferPool = bufferPool; this.generator = new Generator(policy,bufferPool); this.parser = new Parser(policy,bufferPool); this.scheduler = scheduler; this.extensions = new ArrayList<>(); this.suspendToken = new AtomicBoolean(false); this.ioState = new IOState(); this.ioState.addListener(this); this.flusher = new Flusher(bufferPool,generator,endp); this.setInputBufferSize(policy.getInputBufferSize()); this.setMaxIdleTimeout(policy.getIdleTimeout()); }
notifyWebSocketException(e); notifyWebSocketException(new WebSocketException(t));
while (parseFrame(buffer)) notifyFrame(frame); if (frame.isDataFrame() && frame.isFin()) notifyWebSocketException(e); notifyWebSocketException(new WebSocketException(t));
assertSanePayloadLength(payloadLength); if (frame.isMasked()) if (cursor == 0) assertSanePayloadLength(payloadLength); if (frame.isMasked()) if (parsePayload(buffer))
@Override public void onOpen() { boolean beenOpened = opened.getAndSet(true); if (!beenOpened) { WebSocketSession session = getSession(); ConnectionManager connectionManager = connectPromise.getClient().getConnectionManager(); connectionManager.addSession(session); connectPromise.succeeded(session); ByteBuffer extraBuf = connectPromise.getResponse().getRemainingBuffer(); if (extraBuf.hasRemaining()) { LOG.debug("Parsing extra remaining buffer from UpgradeConnection"); getParser().parse(extraBuf); } } super.onOpen(); }
public AbstractWebSocketConnection(EndPoint endp, Executor executor, Scheduler scheduler, WebSocketPolicy policy, ByteBufferPool bufferPool) { super(endp,executor,EXECUTE_ONFILLABLE); // TODO review if this is best. Specifically with MUX this.policy = policy; this.bufferPool = bufferPool; this.generator = new Generator(policy,bufferPool); this.parser = new Parser(policy,bufferPool); this.scheduler = scheduler; this.extensions = new ArrayList<>(); this.suspendToken = new AtomicBoolean(false); this.ioState = new IOState(); this.ioState.setState(ConnectionState.CONNECTING); this.writeBytes = new WriteBytesProvider(generator,new FlushCallback()); this.setInputBufferSize(policy.getInputBufferSize()); }
notifyWebSocketException(e); notifyWebSocketException(new WebSocketException(t));
@Override public void setNextIncomingFrames(IncomingFrames incoming) { getParser().setIncomingFramesHandler(incoming); } }
parser.parse(buffer);
public void configure(Parser parser) { parser.configureFromExtensions(extensions); }
public AbstractWebSocketConnection(EndPoint endp, Executor executor, Scheduler scheduler, WebSocketPolicy policy, ByteBufferPool bufferPool) { super(endp,executor,EXECUTE_ONFILLABLE); // TODO review if this is best. Specifically with MUX this.policy = policy; this.bufferPool = bufferPool; this.generator = new Generator(policy,bufferPool); this.parser = new Parser(policy,bufferPool); this.scheduler = scheduler; this.extensions = new ArrayList<>(); this.suspendToken = new AtomicBoolean(false); this.ioState = new IOState(); this.ioState.setState(ConnectionState.CONNECTING); this.writeBytes = new WriteBytesProvider(generator,new FlushCallback()); this.setInputBufferSize(policy.getInputBufferSize()); }
@Override public void setNextIncomingFrames(IncomingFrames incoming) { getParser().setIncomingFramesHandler(incoming); } }
parser.parse(buffer);