UDP - NotYetConnectedException

"Trustin Lee (이희승)" trustin at gmail.com
Tue Jan 12 22:26:24 EST 2010


You mean Channel.write(Object, SocketAddress) does not work with an
unconnected datagram channel?  Could you let me know how to reproduce
that problem?

Thanks in advance,
Trustin

fps wrote:
> 
> 
> Trustin Lee wrote:
>>  
>>> Why do you I get this NotYetConnectedException when replying to a client
>>> that has just sent a message.?
>> It's because your server side Netty UDP channel is not connected, but
>> just bound.  As stated in the Javadoc of Channel.write(Object), you
>> should use Channel.write(Object, SocketAddress), if you are writing to
>> an unconnected channel.
>>
>> HTH,
>> Trustin
>>
> 
> Hi Trustin
> Yep this is what I was using. I do read the javadocs sometimes ;) But it was
> not working.
> The only way I manage to get it working and several hundred thousands of
> messages sent back and forth is by executing:
> 
> channel.connect(event.getRemoteAddress());
> 
> in a messageReceived(...) method upon receiving the 1st message from the
> client.
> 
> Thx
> Fred

-- 
what we call human nature in actuality is human habit
http://gleamynode.net/


-------------- 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/20100113/9994461e/attachment.bin 


More information about the netty-users mailing list