diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-03-11 00:20:21 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2005-03-11 00:20:21 +0000 |
commit | e57f9e9964ac16b1fd09028ea533457f3029d296 (patch) | |
tree | c500d0de9381444ddfc96985b329e7a254cd1a59 /src/tcp.c | |
parent | 63e3d7c5b0886a4243dd426b2a9f58d2173b26cf (diff) | |
download | luasocket-e57f9e9964ac16b1fd09028ea533457f3029d296.tar.gz luasocket-e57f9e9964ac16b1fd09028ea533457f3029d296.tar.bz2 luasocket-e57f9e9964ac16b1fd09028ea533457f3029d296.zip |
Apparently, non-blocking connect doesn't work on windows if you use 0
timeout in the select call...
Diffstat (limited to 'src/tcp.c')
-rw-r--r-- | src/tcp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -228,8 +228,10 @@ static int meth_connect(lua_State *L) | |||
228 | 228 | ||
229 | static int meth_connected(lua_State *L) | 229 | static int meth_connected(lua_State *L) |
230 | { | 230 | { |
231 | p_tcp tcp = (p_tcp) aux_checkclass(L, "tcp{master}", 1); | 231 | p_tcp tcp; |
232 | int err = sock_connected(&tcp->sock, &tcp->tm); | 232 | int err; |
233 | tcp = (p_tcp) aux_checkclass(L, "tcp{master}", 1); | ||
234 | err = sock_connected(&tcp->sock, &tcp->tm); | ||
233 | if (err != IO_DONE) { | 235 | if (err != IO_DONE) { |
234 | lua_pushnil(L); | 236 | lua_pushnil(L); |
235 | lua_pushstring(L, sock_strerror(err)); | 237 | lua_pushstring(L, sock_strerror(err)); |