aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2015-10-06 11:33:50 +0800
committerDiego Nehab <diego.nehab@gmail.com>2015-10-06 11:33:50 +0800
commitbe67f63f4e11e53690bf1431a236f86b484c9bf0 (patch)
tree2a9e3de162711f3453d238eb49155c4c488189ec /src/select.c
parentfd729b32a8966291f007567f72f3dc0158bdab35 (diff)
downloadluasocket-be67f63f4e11e53690bf1431a236f86b484c9bf0.tar.gz
luasocket-be67f63f4e11e53690bf1431a236f86b484c9bf0.tar.bz2
luasocket-be67f63f4e11e53690bf1431a236f86b484c9bf0.zip
Changed buffer-per-socket to buffer-per-operation.
This is a difficult tradeoff to measure. I think large datagrams won't be used very frequently. So it is better to not lock a large buffer to each socket object and instead allocate and deallocate for each operation receiving a datagram larger than UDP_DATAGRAMSIZE.
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c
index d14c40a..9d133b7 100644
--- a/src/select.c
+++ b/src/select.c
@@ -39,7 +39,10 @@ static luaL_Reg func[] = {
39\*-------------------------------------------------------------------------*/ 39\*-------------------------------------------------------------------------*/
40int select_open(lua_State *L) { 40int select_open(lua_State *L) {
41 lua_pushstring(L, "_SETSIZE"); 41 lua_pushstring(L, "_SETSIZE");
42 lua_pushnumber(L, FD_SETSIZE); 42 lua_pushinteger(L, FD_SETSIZE);
43 lua_rawset(L, -3);
44 lua_pushstring(L, "_SOCKETINVALID");
45 lua_pushinteger(L, SOCKET_INVALID);
43 lua_rawset(L, -3); 46 lua_rawset(L, -3);
44 luaL_setfuncs(L, func, 0); 47 luaL_setfuncs(L, func, 0);
45 return 0; 48 return 0;