[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Why no select in luasocket ?
- From: Edgar Toernig <froese@...>
- Date: Sat, 03 Feb 2001 00:09:28 +0100
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 ;-)