lua-users home
lua-l archive

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


Hello again, Lua-L,


I sent this a few days ago, but I haven't seen any replies yet. I understand that people might just not know, but if someone could just give me a pointer to where I might find my answers (or even just tell me you don't know!), that would be fine.

Thanks again, and apologies for reposting,~Jonathan Castello


> From: solugon@hotmail.com
> To: lua@bazar2.conectiva.com.br
> Subject: Using LuaSocket with non-blocking sockets
> Date: Sun, 11 Oct 2009 17:28:01 -0700
> 
> 
> Hello,> 
> 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 socket.select(nil, {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.
http://clk.atdmt.com/GBL/go/177141665/direct/01/