[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luasocket invalidates its internal state by closing the socket when setsockname() fails
- From: Sam Roberts <vieuxtech@...>
- Date: Fri, 19 Mar 2010 17:41:53 -0700
On Fri, Mar 19, 2010 at 4:22 PM, Ted Unangst <email@example.com> wrote:
> On Wed, Feb 24, 2010 at 6:34 PM, Sam Roberts <firstname.lastname@example.org> 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
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