lua-users home
lua-l archive

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


On Thursday 26 January 2006 5:20 pm, Diego Nehab wrote:
> There are at least two nasty reasons for LuaSocket's socket.select not
> to work well with the file library.
>
> First, on Win32, the select function call can only be used with sockets

ugh

> Even on Unix, Lua uses stream functions (descriptors are not ANSI, I
> guess). Although we could use the non-ANSI fileno function (select is
> not ANSI either, so who cares?), mixing these things would require
> flushing the buffers etc.

right; in unix the clash between FILE* and fd, are the root of lots of evil.

> If anyone has simple solutions for these issues, please let me know. I'd
> me more than happy to adopt it.

i think it would be easiest to just write another file library, that could do 
good enough nonblocking IO.

that's why i propose a base layer just for the select() or similar mechanisms. 
the standard file library works well for embedded environments, where either 
it's ok to block, or most devices are RAM like, and blocking is absurd.

on windows.... maybe select() wouldn't cut it. is there a poll()-like system? 
i think most unixes are evolving to away from select(), anyway


-- 
Javier

Attachment: pgpVqFoi_NbcX.pgp
Description: PGP signature