lua-users home
lua-l archive

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

On Thu, Mar 12, 2009 at 6:17 AM, steve donovan
<> wrote:
> On Wed, Mar 11, 2009 at 7:50 PM, Sam Roberts <> wrote:
>> People routinely hack LuaSocket to support arbitrary fds, search this
>> list for Diego's advice on how to do it.
> Thanks, I'll follow that up
>> He refuses to add it to LuaSocket because it is hard to make work on
>> Windows, which is probably irrelevant to you.
> Windows is just .. different. Pity that Dave Cutler was such a Unix-hater.

Though it does have unified APIs to wait on objects (WaitForMultipleObjects).

I think the real problem is that luasocket was ported from unix, and
so (understandably) is using WSASelect, the semi-unixy API, and that
supports only sockets. The whole thing should be rewritten so that it
uses windows object handles and native APIs, and in particular doesn't
use WSASelect. But basically, the Windows user's of luasocket don't
care enough that they can't treat sockets and files uniformlly to do
this (its possibly a lot of work), so luasocket can't take advantage
of the file/socket uniformity on unix, so windows user's don't notice
that there is any deficiency in luasocket, and here we are...

> I shall try out your code!

Well, look at the other postings, too... some of the other suggestions
were much better than my hack!