List of usage examples for io.netty.channel SimpleChannelInboundHandler subclass-usage
From source file com.hxr.javatone.concurrency.netty.official.discard.DiscardClientHandler.java
/** * Handles a client-side channel. */ public class DiscardClientHandler extends SimpleChannelInboundHandler<Object> { private static final Logger logger = Logger.getLogger(DiscardClientHandler.class.getName());
From source file com.hxr.javatone.concurrency.netty.official.discard.DiscardServerHandler.java
/** * Handles a server-side channel. */ public class DiscardServerHandler extends SimpleChannelInboundHandler<Object> { private static final Logger logger = Logger.getLogger(DiscardServerHandler.class.getName());
From source file com.hxr.javatone.concurrency.netty.official.factorial.FactorialClientHandler.java
/**
* Handler for a client-side channel. This handler maintains stateful
* information which is specific to a certain channel using member variables.
* Therefore, an instance of this handler can cover only one channel. You have
* to create a new handler instance whenever you create a new channel and insert
* this handler to avoid a race condition.
From source file com.hxr.javatone.concurrency.netty.official.factorial.FactorialServerHandler.java
/**
* Handler for a server-side channel. This handler maintains stateful
* information which is specific to a certain channel using member variables.
* Therefore, an instance of this handler can cover only one channel. You have
* to create a new handler instance whenever you create a new channel and insert
* this handler to avoid a race condition.
From source file com.hxr.javatone.concurrency.netty.official.localecho.LocalEchoClientHandler.java
public class LocalEchoClientHandler extends SimpleChannelInboundHandler<Object> { @Override public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception { // Print as received System.out.println(msg);
From source file com.hxr.javatone.concurrency.netty.official.qotm.QuoteOfTheMomentClientHandler.java
public class QuoteOfTheMomentClientHandler extends SimpleChannelInboundHandler<DatagramPacket> { @Override public void messageReceived(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception { String response = msg.content().toString(CharsetUtil.UTF_8); if (response.startsWith("QOTM: ")) {
From source file com.hxr.javatone.concurrency.netty.official.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.hxr.javatone.concurrency.netty.official.rxtx.RxtxClientHandler.java
public class RxtxClientHandler extends SimpleChannelInboundHandler<String> { @Override public void channelActive(ChannelHandlerContext ctx) { ctx.writeAndFlush("AT\n"); }
From source file com.hxr.javatone.concurrency.netty.official.securechat.SecureChatClientHandler.java
/** * Handles a client-side channel. */ public class SecureChatClientHandler extends SimpleChannelInboundHandler<String> { private static final Logger logger = Logger.getLogger(SecureChatClientHandler.class.getName());
From source file com.hxr.javatone.concurrency.netty.official.securechat.SecureChatServerHandler.java
/** * Handles a server-side channel. */ public class SecureChatServerHandler extends SimpleChannelInboundHandler<String> { private static final Logger logger = Logger.getLogger(SecureChatServerHandler.class.getName());