lua-users home
lua-l archive

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


Thursday, January 26, 2006, 5:47:11 PM, Ben Sunshine-Hill wrote:

> On 1/26/06, Jon Smirl <jonsmirl@gmail.com> wrote:
>> I'm not a Windows programmer but don't you use IO completion ports on
>> windows instead of select?

> IOCP's an advanced technique for high-performance server applications.
> Winsock looks and acts almost exactly like UNIX netsockets.

I wrote Lua 5.1 glue to IOCP based I/O on WinXP about a year ago. It
has received little use. If anyone wants to volunteer to polish this
up, exercise it, and publish it, I'd be happy to turn it over. It's
about 1200 lines of C code, 100 lines of Lua, and a Makefile for
Mingw/MSYS.

As another poster pointed out, there should be only one "poll" call in
the system. So it is difficult to package something like this as a
library; it should be "built in" or provided as a piece of
infrastructure; this is what has prevented me from publishing it as is.

Top level functions make EIO_FDs:
    {"open_file", leio_open_file},
    {"open_pipe", leio_open_pipe},
    {"open_socket", leio_open_socket},
    {"open_timer", leio_open_timer},

One poll call:
    {"dequeue", leio_dequeue},

EIO_FD instance methods:
    {"errno", leio_errno},
    {"set_cookie", leio_set_cookie},
    {"get_cookie", leio_get_cookie},
    {"close", leio_close},
    {"read", leio_read},
    {"write", leio_write},
    {"seek", leio_seek},
    {"bind", leio_bind},
    {"listen", leio_listen},
    {"connect", leio_connect},
    {"accept", leio_accept},
    {"shutdown", leio_shutdown},

e

-- 
Doug Currie
Londonderry, NH