List of usage examples for io.netty.channel.socket SocketChannel read
@Override Channel read();
From source file:srebrinb.messagebroker.websocket.WebSocketServerInitializer.java
License:Apache License
@Override public void initChannel(SocketChannel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); if (sslCtx != null) { pipeline.addLast(sslCtx.newHandler(ch.alloc())); }/*w w w. j a va 2s . c o m*/ pipeline.addLast(new HttpServerCodec()); pipeline.addLast(new HttpObjectAggregator(65536)); pipeline.addLast(new WebSocketServerCompressionHandler()); pipeline.addLast(new WebSocketServerProtocolHandler(WEBSOCKET_PATH, null, true)); // pipeline.addLast(new UtsHeadersChannelHandler()); pipeline.addLast(new WebSocketIndexPageHandler(WEBSOCKET_PATH)); pipeline.addLast(new WebSocketFrameHandler()); allChannels.add(ch.read()); String shortID = ch.id().asShortText(); System.out.println(shortID); ch.read().writeAndFlush(new TextWebSocketFrame("Hello " + shortID)); }