Closed Thomas12 closed 9 years ago
At the moment it only support a socket (LuaSocket) instead of a number.
I think you can set the actual fd for LuaSockets through some hack.
Something like
local socket = require "luasocket" local sock = socket.tcp():setfd(10) ioloop:add_handler(sock,...)
Nice idea! Thank you for that suggestion.
_LuaSocketPoll:register looks good, but then I get a "ioloop.lua:444: select failed".
Although in the luasocket c-code it seems it just does an ordinary "select" on fd's.
Later I found on some forums a few complaining that on Windows, select is only working for network sockets and not files. As I couldn't find much about that I do not know if that is the last word on that topic.
Yeah, that could probably be right. Select (or any poll api) on disk backed FDs does not work for Linux/Unix.
I will have a look at it when I have time. Just getting everything working is enough for now :).
This one seems answered right? Select does not support disk FD's? The same as on Unix and Linux... Closing if no more comments arrive within reasonable time.
I try to use add_handler for Windows and I also have a (int) file-descriptor that I pass to add_handler. I get "_LuaSocketPoll:register 184 READ" but 1-2 seconds later I get "attepmt to index a number value". What can I do to make the pure Windows file-descriptor integer suitable for add_handler? (The file descriptor number is from an external C-function). Under Linux passing a pure file-descriptor number works - can it also under Windows?
Thank you!