[erlang-questions] eaddrinuse on connect ?

Fredrik Thulin ft@REDACTED
Tue Dec 12 20:20:23 CET 2006


Tomas Abrahamsson wrote:
...
> I've never tried the reuseaddr on sockets for outgoing
> connects, but here are a couple more ideas, which may
> or may not be suitable for you, depending on your setup:
> 
> * Set up more IP-numbers on the box and bind to them
>   when connecting (ie: set the ip option to
>   gen_tcp:connect/3,4)
> 
>   (This increases the range of available {LocalIP,LocalPort}
>   addresses)

I don't know how to do it (never had this problem), but somehow it 
should be possible to reuse the local port number for outgoing connections.

I should be able to connect to IP1:80 and IP2:80 using the same local 
port number, in the same way that IP1 can connect to my port 80 (from 
say port 1027) at the same time as IP2 connects to my port 80 from it's 
port 1027.

/Fredrik



More information about the erlang-questions mailing list