MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / process_async_connection

Function process_async_connection

src/Chain/libraries/glua/lnetlib.cpp:183–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183static void process_async_connection(lua_State *L, NetServerInfo *server, TcpSocket *socket)
184{
185 // FIXME: 这里用全局变量暂存的方式,对于闭包处理得不好,如果callback函数里使用了非全局变量的upval,可能会出问题
186 lua_getglobal(L, "net_async_handler");
187 if(!lua_isfunction(L, -1))
188 {
189 lua_pop(L, 1);
190 return;
191 }
192 lua_pushlightuserdata(L, socket);
193 lua_pcall(L, 1, 0, 0);
194 lua_pop(L, 2);
195}
196
197static void handle_accept_async(lua_State *L, NetServerInfo *server, TcpSocket *socket,
198 const boost::system::error_code& error)

Callers 1

handle_accept_asyncFunction · 0.85

Calls 2

lua_getglobalFunction · 0.85
lua_pushlightuserdataFunction · 0.85

Tested by

no test coverage detected