[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: LuaSocket - can I select on descriptors that are not socket objects?
- From: Sam Roberts <sroberts@...>
- Date: Wed, 4 Oct 2006 14:35:46 -0700
On Wed, Oct 04, 2006 at 03:49:02PM -0400, Diego Nehab wrote:
> >- It looks like socket.select() only takes a socket object, but I would
> > like to select on other file descriptors. Will I need to create a
> > fd-wrapper object in order to do this?
> Quick dirty undocumented solution: Unix just use a table
> that has a getfd() and dirty() methods (check source code,
> dirty() is to support input buffering). On Windows, this
> won't work. Not my fault, though. Sockets are not file
> descriptors on Windows and select() only works with sockets.
I don't use windows. :-)
> Quick dirty undocumented solution: call setfd().
> On Unix, as long as you have the fd, you are all set.