diff options
Diffstat (limited to 'src/tcp.c')
-rw-r--r-- | src/tcp.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -36,6 +36,7 @@ static int meth_accept(lua_State *L); | |||
36 | static int meth_close(lua_State *L); | 36 | static int meth_close(lua_State *L); |
37 | static int meth_getoption(lua_State *L); | 37 | static int meth_getoption(lua_State *L); |
38 | static int meth_setoption(lua_State *L); | 38 | static int meth_setoption(lua_State *L); |
39 | static int meth_gettimeout(lua_State *L); | ||
39 | static int meth_settimeout(lua_State *L); | 40 | static int meth_settimeout(lua_State *L); |
40 | static int meth_getfd(lua_State *L); | 41 | static int meth_getfd(lua_State *L); |
41 | static int meth_setfd(lua_State *L); | 42 | static int meth_setfd(lua_State *L); |
@@ -65,6 +66,7 @@ static luaL_Reg tcp_methods[] = { | |||
65 | {"setpeername", meth_connect}, | 66 | {"setpeername", meth_connect}, |
66 | {"setsockname", meth_bind}, | 67 | {"setsockname", meth_bind}, |
67 | {"settimeout", meth_settimeout}, | 68 | {"settimeout", meth_settimeout}, |
69 | {"gettimeout", meth_gettimeout}, | ||
68 | {"shutdown", meth_shutdown}, | 70 | {"shutdown", meth_shutdown}, |
69 | {NULL, NULL} | 71 | {NULL, NULL} |
70 | }; | 72 | }; |
@@ -350,6 +352,12 @@ static int meth_settimeout(lua_State *L) | |||
350 | return timeout_meth_settimeout(L, &tcp->tm); | 352 | return timeout_meth_settimeout(L, &tcp->tm); |
351 | } | 353 | } |
352 | 354 | ||
355 | static int meth_gettimeout(lua_State *L) | ||
356 | { | ||
357 | p_tcp tcp = (p_tcp) auxiliar_checkgroup(L, "tcp{any}", 1); | ||
358 | return timeout_meth_gettimeout(L, &tcp->tm); | ||
359 | } | ||
360 | |||
353 | /*=========================================================================*\ | 361 | /*=========================================================================*\ |
354 | * Library functions | 362 | * Library functions |
355 | \*=========================================================================*/ | 363 | \*=========================================================================*/ |