lua-users home
lua-l archive

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


Hi,

Diego Nehab wrote:
> > Why isn't there select() in luasocket?
> 
> The only use of select by a script would to find out which of several
> sockets is ready for a given operation, thus alowing multiplexing. The
> library provides poll for that, and soon multi-threading within Lua will
> render this use less important.

Oh please, don't shoot pthreads at this.  Is it that difficult to add
for example a wait function that gets a list of sockets?  Polling is
nearly useless for anything but embedded systems or DOS.  And timeouts
add an artificial latency that only some applications may tolerate.

> If there is anything you can't do with the current API, please clarify
> and I will try to help.

I only had a short look on luasocket but I would say: wait for any one
of two sockets to become readable ;-)

Ciao, ET.