diff --git a/src/select.c b/src/select.c index fafaa62..da5e37e 100644 --- a/src/select.c +++ b/src/select.c @@ -40,6 +40,9 @@ int select_open(lua_State *L) { lua_pushstring(L, "_SETSIZE"); lua_pushnumber(L, FD_SETSIZE); lua_rawset(L, -3); + lua_pushstring(L, "_SOCKETINVALID"); // for use with getfd() and setfd() + lua_pushnumber(L, SOCKET_INVALID); + lua_rawset(L, -3); #if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE) luaL_setfuncs(L, func, 0); #else diff --git a/src/udp.c b/src/udp.c index 12e320a..a6ddf2f 100644 --- a/src/udp.c +++ b/src/udp.c @@ -120,6 +120,9 @@ int udp_open(lua_State *L) auxiliar_add2group(L, "udp{connected}", "select{able}"); auxiliar_add2group(L, "udp{unconnected}", "select{able}"); /* define library functions */ + lua_pushstring(L, "_UDPDATAGRAMSIZE"); // max send/receive size + lua_pushnumber(L, UDP_DATAGRAMSIZE); + lua_rawset(L, -3); #if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE) luaL_setfuncs(L, func, 0); #else