Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package io.netty.example.objectecho;
- import io.netty.channel.ChannelHandlerContext;
- import io.netty.channel.SimpleChannelInboundHandler;
- import java.util.logging.Logger;
- import net.bounceme.dur.client.jdbc.Title;
- public class ServerHandler extends SimpleChannelInboundHandler<Title> {
- private static final Logger log = Logger.getLogger(ServerHandler.class.getName());
- @Override
- public boolean acceptInboundMessage(Object msg) throws Exception {
- return true;
- }
- @Override
- public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
- log.info(msg.toString());
- ctx.write(new Title());
- }
- @Override
- protected void channelRead0(ChannelHandlerContext chc, Title title) throws Exception {
- log.info(title.toString());
- chc.write(new Title());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment