[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Asynchronous File Input with Copas
- From: Sam Roberts <vieuxtech@...>
- Date: Thu, 12 Mar 2009 11:34:50 -0700
On Thu, Mar 12, 2009 at 6:17 AM, steve donovan
> On Wed, Mar 11, 2009 at 7:50 PM, Sam Roberts <firstname.lastname@example.org> 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!