[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luasocket and selecting from files.
- From: Jorge <xxopxe@...>
- Date: Thu, 02 Jul 2015 02:39:02 +0200
On 01/07/15 14:33, Thijs Schreijer wrote:
I was thinking code preparing a file handle for serving with luasocket.
There seems to be some weird dancing involved with creating a connected
socket, replacing its fd, then invalidating something setting a fd of
LuaSec does this, but its result is still a handle for a socket. But it has some magic in setting the fd and invalidating the original.
Now I get it, the invalidating is done to the keep the original socket
from closing the migrated fd. OTOH, as you mention LuaSec does not need
to deal with files (and it has a C component, so they could sneak a
fileno() binding if needed).
Very useful example anyway, thanks.