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/udp.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/udp.c')
-rw-r--r-- | src/udp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -335,12 +335,14 @@ static int meth_settimeout(lua_State *L) | |||
335 | static int meth_setpeername(lua_State *L) | 335 | static int meth_setpeername(lua_State *L) |
336 | { | 336 | { |
337 | p_udp udp = (p_udp) aux_checkclass(L, "udp{unconnected}", 1); | 337 | p_udp udp = (p_udp) aux_checkclass(L, "udp{unconnected}", 1); |
338 | p_tm tm = &udp->tm; | ||
338 | const char *address = luaL_checkstring(L, 2); | 339 | const char *address = luaL_checkstring(L, 2); |
339 | int connecting = strcmp(address, "*"); | 340 | int connecting = strcmp(address, "*"); |
340 | unsigned short port = connecting ? | 341 | unsigned short port = connecting ? |
341 | (unsigned short) luaL_checknumber(L, 3) : | 342 | (unsigned short) luaL_checknumber(L, 3) : |
342 | (unsigned short) luaL_optnumber(L, 3, 0); | 343 | (unsigned short) luaL_optnumber(L, 3, 0); |
343 | const char *err = inet_tryconnect(&udp->sock, address, port); | 344 | const char *err; |
345 | err = inet_tryconnect(&udp->sock, address, port, tm_getfailure(tm)); | ||
344 | if (err) { | 346 | if (err) { |
345 | lua_pushnil(L); | 347 | lua_pushnil(L); |
346 | lua_pushstring(L, err); | 348 | lua_pushstring(L, err); |