aboutsummaryrefslogtreecommitdiff
path: root/src/tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tcp.c')
-rw-r--r--src/tcp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tcp.c b/src/tcp.c
index e4f1a4b..ef9ee6f 100644
--- a/src/tcp.c
+++ b/src/tcp.c
@@ -36,6 +36,7 @@ static int meth_accept(lua_State *L);
36static int meth_close(lua_State *L); 36static int meth_close(lua_State *L);
37static int meth_getoption(lua_State *L); 37static int meth_getoption(lua_State *L);
38static int meth_setoption(lua_State *L); 38static int meth_setoption(lua_State *L);
39static int meth_gettimeout(lua_State *L);
39static int meth_settimeout(lua_State *L); 40static int meth_settimeout(lua_State *L);
40static int meth_getfd(lua_State *L); 41static int meth_getfd(lua_State *L);
41static int meth_setfd(lua_State *L); 42static 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
355static 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\*=========================================================================*/