Reputation: 1067
I am developing a socket based app using Netty 3.6.x. However I am encountering an issue with the channel.write. This is what I did: First whenever the channel goes to the CONNECTED state I write to the channel and it is successful. Now when the server goes done I try reconnect to it and when the channel is connected I try write to it but this time it seems that the server did not receive the data.
Also when I check the write state it say done.
What can be the issue?
Upvotes: 0
Views: 1588
Reputation: 1067
Thank you Norman. I have fixed the issue. The issue was that I was using the the ChannelFuture listener and I realized that I was setting the pipeline and the transcoder within that callback. So when I sent the data over the wire it is not encoded properly. To solve I have to handle every in the channelConnected and channelCLosed method.
Upvotes: 0
Reputation: 23557
You should check if the ChannelFuture was failed and if so inspect the the error via:
ChannelFuture future = ...
if (!future.isSuccess()) {
future.getCause().printStacktrace();
}
This should show you the reason why it failed.
Upvotes: 2