Ridiculous newbie question
vibeofboston
djvibe_alb at yahoo.com
Sat Apr 3 01:22:43 EDT 2010
This might sound really stupid but I can't seem to figure it out. I have the
same exact code as in Chapter 1 of Netty documentation but I can't seem to
connet to the server thru telnet.
I looked at the ports running [using netstat] and it said established but
then it went to TIME_WAIT. why is the connection lost.
ChannelFactory factory= new
NioServerSocketChannelFactory(Executors.newCachedThreadPool(),
Executors.newCachedThreadPool());
ServerBootstrap bootstrapper= new ServerBootstrap(factory);
EchoHandler handler= new EchoHandler();
ChannelPipeline pipeline= bootstrapper.getPipeline();
pipeline.addLast("handler", handler);
bootstrapper.setOption("child.tcpNoDelay", true);
bootstrapper.setOption("child.keepAlive", true);
bootstrapper.setOption("child.reuseAddress", true);
bootstrapper.bind(new InetSocketAddress("localhost", 8080));
System.out.println("Running...");
@ChannelPipelineCoverage("all")
public class EchoHandler extends SimpleChannelHandler{
@Override
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
throws Exception {
Channel channel= e.getChannel();
channel.write("Hello " + e.getMessage());
}
@Override
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
throws Exception {
Channel ch= e.getChannel();
ch.close();
}
}
--
View this message in context: http://n2.nabble.com/Ridiculous-newbie-question-tp4845908p4845908.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list