1 /* Win32 ioset backend for srvx
2 * Copyright 2006 srvx Development Team
4 * This file is part of srvx.
6 * srvx is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with srvx; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 #include "ioset-impl.h"
25 /* This is massively kludgy. Unfortunately, the only performant I/O
26 * multiplexer with halfway decent semantics under Windows is
27 * WSAAsyncSelect() -- which requires a window that can receive
30 * So ioset_win32_init() creates a hidden window and sets it up for
31 * asynchronous socket notifications.
35 ioset_win32_init(void)
40 res = WSAStartup(MAKEWORD(2, 0), &wsadata);
41 // TODO: finish implementing ioset_win32_init()
46 ioset_win32_add(struct io_fd *fd)
48 // TODO: implement ioset_win32_add()
52 ioset_win32_remove(struct io_fd *fd)
54 // TODO: implement ioset_win32_remove()
58 ioset_win32_update(struct io_fd *fd)
60 // TODO: implement ioset_win32_update()
64 ioset_win32_cleanup(void)
66 // TODO: finish implementing ioset_win32_cleanup()
71 ioset_win32_loop(struct timeval *timeout)
73 // TODO: implement ioset_win32_loop()
77 struct io_engine io_engine_win32 = {
79 .init = ioset_win32_init,
80 .add = ioset_win32_add,
81 .remove = ioset_win32_remove,
82 .update = ioset_win32_update,
83 .loop = ioset_win32_loop,
84 .cleanup = ioset_win32_cleanup,