diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-01-17 08:02:04 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-01-17 08:02:04 +0000 |
| commit | 02ef4e7daae6bef629dcb568052755fb85ed2efc (patch) | |
| tree | 3001b5d4429626e086b457ade7a899428fbfeb34 /src/tcp.c | |
| parent | 076451c75336b30e6152bd5c02f355db39107f7d (diff) | |
| download | luasocket-02ef4e7daae6bef629dcb568052755fb85ed2efc.tar.gz luasocket-02ef4e7daae6bef629dcb568052755fb85ed2efc.tar.bz2 luasocket-02ef4e7daae6bef629dcb568052755fb85ed2efc.zip | |
Trying to get rid of EINTR problems...
Diffstat (limited to 'src/tcp.c')
| -rw-r--r-- | src/tcp.c | 7 |
1 files changed, 5 insertions, 2 deletions
| @@ -257,7 +257,10 @@ static int meth_connect(lua_State *L) | |||
| 257 | p_tcp tcp = (p_tcp) aux_checkclass(L, "tcp{master}", 1); | 257 | p_tcp tcp = (p_tcp) aux_checkclass(L, "tcp{master}", 1); |
| 258 | const char *address = luaL_checkstring(L, 2); | 258 | const char *address = luaL_checkstring(L, 2); |
| 259 | unsigned short port = (unsigned short) luaL_checknumber(L, 3); | 259 | unsigned short port = (unsigned short) luaL_checknumber(L, 3); |
| 260 | const char *err = inet_tryconnect(&tcp->sock, address, port); | 260 | p_tm tm = &tcp->tm; |
| 261 | const char *err; | ||
| 262 | tm_markstart(tm); | ||
| 263 | err = inet_tryconnect(&tcp->sock, address, port, tm_getfailure(tm)); | ||
| 261 | if (err) { | 264 | if (err) { |
| 262 | lua_pushnil(L); | 265 | lua_pushnil(L); |
| 263 | lua_pushstring(L, err); | 266 | lua_pushstring(L, err); |
| @@ -326,7 +329,7 @@ static int meth_getsockname(lua_State *L) | |||
| 326 | \*-------------------------------------------------------------------------*/ | 329 | \*-------------------------------------------------------------------------*/ |
| 327 | static int meth_settimeout(lua_State *L) | 330 | static int meth_settimeout(lua_State *L) |
| 328 | { | 331 | { |
| 329 | p_tcp tcp = (p_tcp) aux_checkgroup(L, "tcp{client,server}", 1); | 332 | p_tcp tcp = (p_tcp) aux_checkgroup(L, "tcp{any}", 1); |
| 330 | return tm_meth_settimeout(L, &tcp->tm); | 333 | return tm_meth_settimeout(L, &tcp->tm); |
| 331 | } | 334 | } |
| 332 | 335 | ||
