List of usage examples for io.netty.channel SimpleChannelInboundHandler subclass-usage
From source file com.hop.hhxx.example.discard.DiscardClientHandler.java
/** * Handles a client-side channel. */ public class DiscardClientHandler extends SimpleChannelInboundHandler<Object> { private ByteBuf content;
From source file com.hop.hhxx.example.discard.DiscardServerHandler.java
/** * Handles a server-side channel. */ public class DiscardServerHandler extends SimpleChannelInboundHandler<Object> { @Override
From source file com.hop.hhxx.example.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.hop.hhxx.example.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.hop.hhxx.example.file.FileServerHandler.java
public class FileServerHandler extends SimpleChannelInboundHandler<String> { @Override public void channelActive(ChannelHandlerContext ctx) { ctx.writeAndFlush("HELO: Type the path of the file to retrieve.\n"); }
From source file com.hop.hhxx.example.http.cors.OkResponseHandler.java
/** * A simple handler which will simple return a successful Http * response for any request. */ public class OkResponseHandler extends SimpleChannelInboundHandler<Object> { @Override
From source file com.hop.hhxx.example.http.file.HttpStaticFileServerHandler.java
/**
* A simple handler that serves incoming HTTP requests to send their respective
* HTTP responses. It also implements {@code 'If-Modified-Since'} header to
* take advantage of browser cache, as described in
* <a href="http://tools.ietf.org/html/rfc2616#section-14.25">RFC 2616</a>.
*
From source file com.hop.hhxx.example.http.snoop.HttpSnoopClientHandler.java
public class HttpSnoopClientHandler extends SimpleChannelInboundHandler<HttpObject> { @Override public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) { if (msg instanceof HttpResponse) { HttpResponse response = (HttpResponse) msg;
From source file com.hop.hhxx.example.http.snoop.HttpSnoopServerHandler.java
public class HttpSnoopServerHandler extends SimpleChannelInboundHandler<Object> { private HttpRequest request; /** Buffer that stores the response content */ private final StringBuilder buf = new StringBuilder();
From source file com.hop.hhxx.example.http.upload.HttpUploadClientHandler.java
/** * Handler that just dumps the contents of the response from the server */ public class HttpUploadClientHandler extends SimpleChannelInboundHandler<HttpObject> { private boolean readingChunks;