[erlang-questions] eaddrinuse on connect ?

Tomas Abrahamsson tomas.abrahamsson@REDACTED
Wed Dec 13 11:12:19 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.

That could perhaps be done as discussed in the thread at


More information about the erlang-questions mailing list