Newbie question

geranimo salimoflaz at gmail.com
Tue Jan 5 17:47:31 EST 2010


Hi,
I wrote the server part of a client/server program which uses netty
non-blocking IO. When I debug the program it works as expected. But When I
run the program it doesn't behave as expected. Same things happenned when I
was not using netty, the native java NIO library. My client is a
time-attendance machine and I guess it's processing very slowly and I
couldn't catch up with the rhtym of the machine.      

ChannelFuture future =
e.getChannel().write(processMessage((String)e.getMessage()));
        
future.addListener(new ChannelFutureListener() {

   public void operationComplete(ChannelFuture future)
                    throws Exception {
            	System.out.println("messageReceived \nfuture.isCancelled()"  
                  future.isCancelled() +
            	"\nfuture.isDone()" +                                                 
future.isDone() 	"\nfuture.isSuccess()" + future.isSuccess());
            	if (!future.isSuccess()) {
                    future.getCause().printStackTrace();
                    future.getChannel().close();
                    return;
                }
            }
            });

I tried adding debug statements, isCancelled is false and the others are
true. I plan to implement blocking IO with netty, any pointers for this
newbie? Simply the time-attendance machine doesn't getting message when
running, but it do recieve when debugging. When I was implementing the
server with the native Java NIO library I was putting thread.sleep()
statements before write data to channel. But this is not what I want to do.
So what do you recommend to me in order to find the source of the problem? I
tried to resend the data regardless of the future.isSuccess, this partially
works but at this time time attendance machine crashes. Any suggestions? 


Best Regards,
Salim
-- 
View this message in context: http://n2.nabble.com/Newbie-question-tp4257945p4257945.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list