List of usage examples for io.netty.channel SimpleChannelInboundHandler subclass-usage
From source file com.flysoloing.learning.network.netty.http2.tiles.FallbackRequestHandler.java
/** * Handles the exceptional case where HTTP 1.x was negotiated under TLS. */ public final class FallbackRequestHandler extends SimpleChannelInboundHandler<HttpRequest> { private static final ByteBuf response = unreleasableBuffer(copiedBuffer(
From source file com.flysoloing.learning.network.netty.http2.tiles.Http2RequestHandler.java
/**
* Handles all the requests for data. It receives a {@link FullHttpRequest},
* which has been converted by a {@link InboundHttp2ToHttpAdapter} before it
* arrived here. For further details, check {@link Http2OrHttpHandler} where the
* pipeline is setup.
*/
From source file com.flysoloing.learning.network.netty.localecho.LocalEchoClientHandler.java
public class LocalEchoClientHandler extends SimpleChannelInboundHandler<Object> { @Override public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception { // Print as received System.out.println(msg);
From source file com.flysoloing.learning.network.netty.qotm.QuoteOfTheMomentClientHandler.java
public class QuoteOfTheMomentClientHandler extends SimpleChannelInboundHandler<DatagramPacket> { @Override public void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception { String response = msg.content().toString(CharsetUtil.UTF_8); if (response.startsWith("QOTM: ")) {
From source file com.flysoloing.learning.network.netty.qotm.QuoteOfTheMomentServerHandler.java
public class QuoteOfTheMomentServerHandler extends SimpleChannelInboundHandler<DatagramPacket> { private static final Random random = new Random(); // Quotes from Mohandas K. Gandhi: private static final String[] quotes = { "Where there is love there is life.",
From source file com.flysoloing.learning.network.netty.rxtx.RxtxClientHandler.java
public class RxtxClientHandler extends SimpleChannelInboundHandler<String> { @Override public void channelActive(ChannelHandlerContext ctx) { ctx.writeAndFlush("AT\n"); }
From source file com.flysoloing.learning.network.netty.securechat.SecureChatClientHandler.java
/** * Handles a client-side channel. */ public class SecureChatClientHandler extends SimpleChannelInboundHandler<String> { @Override
From source file com.flysoloing.learning.network.netty.securechat.SecureChatServerHandler.java
/** * Handles a server-side channel. */ public class SecureChatServerHandler extends SimpleChannelInboundHandler<String> { static final ChannelGroup channels = new DefaultChannelGroup(GlobalEventExecutor.INSTANCE);
From source file com.flysoloing.learning.network.netty.socksproxy.SocksServerConnectHandler.java
@ChannelHandler.Sharable public final class SocksServerConnectHandler extends SimpleChannelInboundHandler<SocksMessage> { private final Bootstrap b = new Bootstrap(); @Override
From source file com.flysoloing.learning.network.netty.socksproxy.SocksServerHandler.java
@ChannelHandler.Sharable public final class SocksServerHandler extends SimpleChannelInboundHandler<SocksMessage> { public static final SocksServerHandler INSTANCE = new SocksServerHandler(); private SocksServerHandler() {