@Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { // Discard all data received if closing handshake was received before. if (receivedClosingHandshake) { in.skipBytes(actualReadableBytes()); return; } // Decode a frame otherwise. byte type = in.readByte(); WebSocketFrame frame; if ((type & 0x80) == 0x80) { // If the MSB on type is set, decode the frame length frame = decodeBinaryFrame(ctx, type, in); } else { // Decode a 0xff terminated UTF-8 string frame = decodeTextFrame(ctx, in); } if (frame != null) { out.add(frame); } }
@Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { // Discard all data received if closing handshake was received before. if (receivedClosingHandshake) { in.skipBytes(actualReadableBytes()); return; } // Decode a frame otherwise. byte type = in.readByte(); WebSocketFrame frame; if ((type & 0x80) == 0x80) { // If the MSB on type is set, decode the frame length frame = decodeBinaryFrame(ctx, type, in); } else { // Decode a 0xff terminated UTF-8 string frame = decodeTextFrame(ctx, in); } if (frame != null) { out.add(frame); } }
@Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { // Discard all data received if closing handshake was received before. if (receivedClosingHandshake) { in.skipBytes(actualReadableBytes()); return; } // Decode a frame otherwise. byte type = in.readByte(); WebSocketFrame frame; if ((type & 0x80) == 0x80) { // If the MSB on type is set, decode the frame length frame = decodeBinaryFrame(ctx, type, in); } else { // Decode a 0xff terminated UTF-8 string frame = decodeTextFrame(ctx, in); } if (frame != null) { out.add(frame); } }
@Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { // Discard all data received if closing handshake was received before. if (receivedClosingHandshake) { in.skipBytes(actualReadableBytes()); return; } // Decode a frame otherwise. byte type = in.readByte(); WebSocketFrame frame; if ((type & 0x80) == 0x80) { // If the MSB on type is set, decode the frame length frame = decodeBinaryFrame(ctx, type, in); } else { // Decode a 0xff terminated UTF-8 string frame = decodeTextFrame(ctx, in); } if (frame != null) { out.add(frame); } }
@Override protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { // Discard all data received if closing handshake was received before. if (receivedClosingHandshake) { in.skipBytes(actualReadableBytes()); return; } // Decode a frame otherwise. byte type = in.readByte(); WebSocketFrame frame; if ((type & 0x80) == 0x80) { // If the MSB on type is set, decode the frame length frame = decodeBinaryFrame(ctx, type, in); } else { // Decode a 0xff terminated UTF-8 string frame = decodeTextFrame(ctx, in); } if (frame != null) { out.add(frame); } }