Newbie question

"Trustin Lee (이희승)" trustin at gmail.com
Wed Jan 6 05:39:53 EST 2010


Hi Salim,

If both your native NIO server and Netty server exhibits the same
problem and you did not violate the protocol, I suspect there is a bug
in the client (the time-attendance machine).  To see what's being
written and received, you could use a packet capturing tool like WireShark.

HTH,
Trustin

geranimo wrote:
> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20100106/ce3c9b67/attachment.bin 


More information about the netty-users mailing list