List of usage examples for io.netty.channel SimpleChannelInboundHandler subclass-usage
From source file com.hop.hhxx.example.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.hop.hhxx.example.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.hop.hhxx.example.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.hop.hhxx.example.rxtx.RxtxClientHandler.java
public class RxtxClientHandler extends SimpleChannelInboundHandler<String> { @Override public void channelActive(ChannelHandlerContext ctx) { ctx.writeAndFlush("AT\n"); }
From source file com.hop.hhxx.example.securechat.SecureChatClientHandler.java
/** * Handles a client-side channel. */ public class SecureChatClientHandler extends SimpleChannelInboundHandler<String> { @Override
From source file com.hop.hhxx.example.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.hop.hhxx.example.socksproxy.SocksServerConnectHandler.java
@ChannelHandler.Sharable public final class SocksServerConnectHandler extends SimpleChannelInboundHandler<SocksMessage> { private final Bootstrap b = new Bootstrap(); @Override
From source file com.hop.hhxx.example.socksproxy.SocksServerHandler.java
@ChannelHandler.Sharable public final class SocksServerHandler extends SimpleChannelInboundHandler<SocksMessage> { public static final SocksServerHandler INSTANCE = new SocksServerHandler(); private SocksServerHandler() {
From source file com.hop.hhxx.example.spdy.client.HttpResponseClientHandler.java
/** * This is a modified version of {@link HttpSnoopClientHandler} that uses a {@link BlockingQueue} to wait until an * HTTPResponse is received. */ public class HttpResponseClientHandler extends SimpleChannelInboundHandler<HttpObject> {
From source file com.hop.hhxx.example.spdy.server.SpdyServerHandler.java
/** * HTTP handler that responds with a "Hello World" */ public class SpdyServerHandler extends SimpleChannelInboundHandler<Object> { @Override