Am 01.07.2008 um 17:03 schrieb Ian Piumarta:
> Hi Bert,
>
> On Jul 1, 2008, at 6:35 AM, Bert Freudenberg wrote:
>
>> which means the second socket listens successfully, but on a random
>> port. I verified it is actually listening there using lsof. The
>> SO_REUSEADDR option does not make any difference, btw.
>>
>> I think I should not rely on it. Also, the same code gives an error
>> (as expected) on Windows.
>
> The behaviour you're seeing seems broken to me; bind() should fail
> if another socket is already bound to the same listening address.
> I'll take a look.
In the mean time I found that the new SocketAddressInfo-based code
actually gives an error when binding, as expected. Only the old
primitiveSocketListenWithOrWithoutBacklog silently binds to a random
port.
- Bert -