lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


This is purely a luasocket behaviour. The system calls allow bind() to
fail, leaving the socket valid.

This behaviour of luasocket is particularly anti-social when
attempting to repeatedly bind to local ports, to search for one that
is free.

Is there any update on this issue?  Is it safe to remove, in inet_trybind,
socket_destroy(ps) ?   Or is that destruction relied on elsewhere (ex:
socket.bind) ?

I think it is safe. The reason it is there is because I had
read somewhere that once a call to bind fails, you shouldn't
use the socket again. I have been unable to find a reference
for this again, so I have to assume I was dreaming. :/