@Override public WsBuffer wrap(ByteBuffer buf, int flags) { boolean shared = (flags & IoBufferEx.FLAG_SHARED) != IoBufferEx.FLAG_NONE; return shared ? new WsSharedBuffer(buf) : new WsUnsharedBuffer(buf); }
@Override protected WsUnsharedBuffer asUnsharedBuffer0() { return new WsUnsharedBuffer(buf()); }
@Override protected WsSharedBuffer asSharedBuffer0() { return new WsSharedBuffer(buf()); }
public WsnConnector() { super(new DefaultIoSessionConfigEx()); postUpgrade = new HttpPostUpgradeFilter(); codec = new WsCodecFilter(0, true); base64 = new WsFrameBase64Filter(); text = new WsFrameTextFilter(); }
@Override protected IoBufferEx doBinaryEncode(IoBufferAllocatorEx<?> allocator, int flags, WsMessage message) { return WsDraftHixieFrameEncodingSupport.doBinaryEncode(allocator, flags, message); }
@Override protected WsBuffer create1(MessageBuffer<WsMessage> parent, ByteBuffer buf) { return new WsSharedBuffer(parent, buf); }
@Override protected IoBufferEx doCloseEncode(IoBufferAllocatorEx<?> allocator, int flags, WsCloseMessage message) { return WsDraftHixieFrameEncodingSupport.doCloseEncode(allocator, flags); }
@Override protected IoBufferEx doCloseEncode(IoBufferAllocatorEx<?> allocator, int flags, WsCloseMessage message) { return doMessageEncode(allocator, flags, message); }
/** * @param wsMaxMessageSize Maximum permitted number of bytes in a message being decoded. If <0 there is no limit. */ public WsCodecFilter(int wsMaxMessageSize, boolean maskSends) { super(new WsCodecFactory(wsMaxMessageSize > 0 ? wsMaxMessageSize : 0, maskSends)); }
public AbstractWsFrameEncoder(CachingMessageEncoder cachingEncoder, IoBufferAllocatorEx<?> allocator) { this.allocator = allocator; this.cachingEncoder = cachingEncoder; this.encoder = new WsMessageEncoderImpl(); }
/** * @param wsMaxMessageSize Maximum permitted number of bytes in a message being decoded. If <0 there is no limit. */ public WsDraftHixieFrameCodecFilter(int wsMaxMessageSize) { super(new WsCodecFactory(wsMaxMessageSize > 0 ? wsMaxMessageSize : 0)); }
@Override public IoBufferEx encode(IoBufferAllocatorEx<?> allocator, WsMessage message, int flags) { return doEncode(allocator, flags, message); } }
@Override protected DecodingState finishDecode(List<Object> childProducts, ProtocolDecoderOutput out) throws Exception { flush(childProducts, out); return null; }
@Override protected IoBufferEx doTextEncode(IoBufferAllocatorEx<?> allocator, int flags, WsMessage message) { return WsDraftHixieFrameEncodingSupport.doTextEncode(allocator, flags, message); }
private void schedulePing(IoSessionEx session) { nextAction = NextAction.PING; setReadIdleTimeInMillis(session, pingDelay); }
public static IoBufferEx doSpecifiedLengthTextEncode(IoBufferAllocatorEx<?> allocator, int flags, WsMessage message) { return doEncode(allocator, flags, message, SPECIFIED_LENGTH_TEXT_TYPE_BYTE); }
@Override public WsBuffer wrap(ByteBuffer nioBuffer, int flags) { boolean shared = (flags & IoBufferEx.FLAG_SHARED) != IoBufferEx.FLAG_NONE; return shared ? new WsSharedBuffer(nioBuffer) : new WsUnsharedBuffer(nioBuffer); }
@Override protected IoBufferEx doTextEncode(IoBufferAllocatorEx<?> allocator, int flags, WsMessage message) { return doMessageEncode(allocator, flags, message); }
@Override public WsBuffer wrap(ByteBuffer nioBuffer, int flags) { boolean shared = (flags & IoBufferEx.FLAG_SHARED) != IoBufferEx.FLAG_NONE; return shared ? new WsSharedBuffer(nioBuffer) : new WsUnsharedBuffer(nioBuffer); }