diff options
Diffstat (limited to 'src/udp.c')
-rw-r--r-- | src/udp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -30,7 +30,7 @@ static int meth_setsockname(lua_State *L); | |||
30 | static int meth_setpeername(lua_State *L); | 30 | static int meth_setpeername(lua_State *L); |
31 | static int meth_close(lua_State *L); | 31 | static int meth_close(lua_State *L); |
32 | static int meth_setoption(lua_State *L); | 32 | static int meth_setoption(lua_State *L); |
33 | static int meth_timeout(lua_State *L); | 33 | static int meth_settimeout(lua_State *L); |
34 | static int meth_fd(lua_State *L); | 34 | static int meth_fd(lua_State *L); |
35 | static int meth_dirty(lua_State *L); | 35 | static int meth_dirty(lua_State *L); |
36 | static int opt_dontroute(lua_State *L); | 36 | static int opt_dontroute(lua_State *L); |
@@ -46,7 +46,7 @@ static luaL_reg udp[] = { | |||
46 | {"sendto", meth_sendto}, | 46 | {"sendto", meth_sendto}, |
47 | {"receive", meth_receive}, | 47 | {"receive", meth_receive}, |
48 | {"receivefrom", meth_receivefrom}, | 48 | {"receivefrom", meth_receivefrom}, |
49 | {"timeout", meth_timeout}, | 49 | {"settimeout", meth_settimeout}, |
50 | {"close", meth_close}, | 50 | {"close", meth_close}, |
51 | {"setoption", meth_setoption}, | 51 | {"setoption", meth_setoption}, |
52 | {"__gc", meth_close}, | 52 | {"__gc", meth_close}, |
@@ -252,10 +252,10 @@ static int opt_broadcast(lua_State *L) | |||
252 | /*-------------------------------------------------------------------------*\ | 252 | /*-------------------------------------------------------------------------*\ |
253 | * Just call tm methods | 253 | * Just call tm methods |
254 | \*-------------------------------------------------------------------------*/ | 254 | \*-------------------------------------------------------------------------*/ |
255 | static int meth_timeout(lua_State *L) | 255 | static int meth_settimeout(lua_State *L) |
256 | { | 256 | { |
257 | p_udp udp = (p_udp) aux_checkgroup(L, "udp{any}", 1); | 257 | p_udp udp = (p_udp) aux_checkgroup(L, "udp{any}", 1); |
258 | return tm_meth_timeout(L, &udp->tm); | 258 | return tm_meth_settimeout(L, &udp->tm); |
259 | } | 259 | } |
260 | 260 | ||
261 | /*-------------------------------------------------------------------------*\ | 261 | /*-------------------------------------------------------------------------*\ |
@@ -297,7 +297,7 @@ static int meth_close(lua_State *L) | |||
297 | \*-------------------------------------------------------------------------*/ | 297 | \*-------------------------------------------------------------------------*/ |
298 | static int meth_setsockname(lua_State *L) | 298 | static int meth_setsockname(lua_State *L) |
299 | { | 299 | { |
300 | p_udp udp = (p_udp) aux_checkclass(L, "udp{master}", 1); | 300 | p_udp udp = (p_udp) aux_checkclass(L, "udp{unconnected}", 1); |
301 | const char *address = luaL_checkstring(L, 2); | 301 | const char *address = luaL_checkstring(L, 2); |
302 | unsigned short port = (unsigned short) luaL_checknumber(L, 3); | 302 | unsigned short port = (unsigned short) luaL_checknumber(L, 3); |
303 | const char *err = inet_trybind(&udp->sock, address, port, -1); | 303 | const char *err = inet_trybind(&udp->sock, address, port, -1); |