lua-users home
lua-l archive

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

On Fri, Mar 19, 2010 at 4:22 PM, Ted Unangst <> wrote:
> On Wed, Feb 24, 2010 at 6:34 PM, Sam Roberts <> wrote:
>> This is purely a luasocket behaviour. The system calls allow bind() to
>> fail, leaving the socket valid.
> Only on some systems.

a) If such a system exists, wouldn't this be considered an unfortunate
bug in that system?

>> This behaviour of luasocket is particularly anti-social when
>> attempting to repeatedly bind to local ports, to search for one that
>> is free.
> You're supposed to create a new socket after a failed bind.  Read your
> Stevens. :)

b) Do you have a page or section reference?

I find no mention of this in "Unix Network Progamming - Networking
APIs: Sockets and XTI", 2ed, under the bind or udp docs, but its a big
book. I have copies of TCP/IP illustrated, too, if you find this claim
in them.

Also, those books are old. In none of  these do I see a claim that
returning an error invalidates the descriptor:

I do see "A process with a connnected UDP socket can call connect
again for that socket." (p.226, also the freebsd man pages). This
isn't supported by luasocket, either, connected sockets can only be