lua-users home
lua-l archive

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

I'm using non-blocking sockets with LuaSocket under Win32, and I find myself looking for a way to tell if a connect() call failed. I can use, {sock}, 0) to see if the socket has connected successfully, but I don't see any way to tell if it failed. Looking over the WinSock documentation, I notice an 'exceptfds' parameter that comes after the read and write tables, but LuaSocket doesn't appear to use it at all (its source shows NULL used instead). The WinSock documentation says that if a nonblocking socket failed to connect, passing it in as part of 'exceptfds' would return the socket as part of that list.
Does anyone have any suggestions for how to work around this? Or better, can anyone explain why 'exceptfds' is ignored in LuaSocket? I can't use blocking sockets due to the environment I'm writing this script for (as a plugin to a single-threaded process), and I don't want to lock up the rest of the environment with blocking calls.
Thank you,~Jonathan Castello 		 	   		  
Hotmail: Trusted email with powerful SPAM protection.