Apparently, non-blocking connect doesn't work on windows if you use 0

timeout in the select call...
This commit is contained in:
Diego Nehab 2005-03-11 00:20:21 +00:00
parent 63e3d7c5b0
commit e57f9e9964
7 changed files with 106 additions and 100 deletions

View file

@ -228,8 +228,10 @@ static int meth_connect(lua_State *L)
static int meth_connected(lua_State *L)
{
p_tcp tcp = (p_tcp) aux_checkclass(L, "tcp{master}", 1);
int err = sock_connected(&tcp->sock, &tcp->tm);
p_tcp tcp;
int err;
tcp = (p_tcp) aux_checkclass(L, "tcp{master}", 1);
err = sock_connected(&tcp->sock, &tcp->tm);
if (err != IO_DONE) {
lua_pushnil(L);
lua_pushstring(L, sock_strerror(err));