mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
gate support TCP_NODELAY
This commit is contained in:
@@ -476,6 +476,14 @@ lstart(lua_State *L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
lnodelay(lua_State *L) {
|
||||
struct skynet_context * ctx = lua_touserdata(L, lua_upvalueindex(1));
|
||||
int id = luaL_checkinteger(L, 1);
|
||||
skynet_socket_nodelay(ctx,id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
luaopen_socketdriver(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
@@ -502,6 +510,7 @@ luaopen_socketdriver(lua_State *L) {
|
||||
{ "lsend", lsendlow },
|
||||
{ "bind", lbind },
|
||||
{ "start", lstart },
|
||||
{ "nodelay", lnodelay },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
lua_getfield(L, LUA_REGISTRYINDEX, "skynet_context");
|
||||
|
||||
Reference in New Issue
Block a user