Netty examples fail to bind

Marc-André Laverdière marcandre.laverdiere at gmail.com
Thu Jun 17 07:27:49 EDT 2010


Are you sure its the server socket that throws that exception, or is
it the client(s)?

The reason I'm asking that is that I had that kind of exception with
client sockets with multiple threads (that was using JNDI)... the
client sockets somehow wanted to all be on the same port and it was
throwing that exception. The solution was to synchronize that bit of
code.

It feels like a VM issue... how come it doesn't pick a random port in
an atomic way?

Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and
complete, not lacking anything." -James 1:4
mlaverd.theunixplace.com/blog

 /"\
 \ /    ASCII Ribbon Campaign
  X      against HTML e-mail
 / \



2010/6/17 "이희승 (Trustin Lee)" <trustin at gmail.com>:
> Hi Tristan,
>
> That's a problem I have never heard before..  Please let me know once
> you got to know how to reproduce the problem reliably in different machines.
>
> Thanks,
> Trustin
>
> On 06/16/2010 01:48 AM, kungfooguru wrote:
>>
>> I am attempting to use the examples that come with the Netty source code.
>> I've loaded them up in Eclipse and started with the Echo example. The server
>> appears to start fine and the ThroughputMonitor begins to write to the
>> console. The server does not throw any exceptions until I attempt to connect
>> with the echo client and the exception is 'Exception in thread "main"
>> org.jboss.netty.channel.ChannelException: Failed to bind to: ... Caused by:
>> java.net.BindException: Address already in use'. I've tried different ports
>> and I have checked through netstat to see that they aren't being used before
>> trying but it still happens... Even weirder is that this isn't thrown till I
>> run the client. I no idea at all how a client can cause that to happen,
>> haha. If it can't bind to the port it should never know the client is
>> sending something to it!
>>
>> Any help would much appreciated.
>>
>> Thanks,
>> Tristan
>
> --
> what we call human nature in actuality is human habit
> http://gleamynode.net/
>
>
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>



More information about the netty-users mailing list