mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
redesign connection module
This commit is contained in:
@@ -97,6 +97,14 @@ _command(lua_State *L) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
_genid(lua_State *L) {
|
||||
struct skynet_context * context = lua_touserdata(L, lua_upvalueindex(1));
|
||||
int session = skynet_send(context, NULL, NULL, -1, NULL, 0 , 0);
|
||||
lua_pushinteger(L, session);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_send(lua_State *L) {
|
||||
struct skynet_context * context = lua_touserdata(L, lua_upvalueindex(1));
|
||||
@@ -183,6 +191,7 @@ luaopen_skynet_c(lua_State *L) {
|
||||
luaL_checkversion(L);
|
||||
luaL_Reg l[] = {
|
||||
{ "send" , _send },
|
||||
{ "genid", _genid },
|
||||
{ "redirect", _redirect },
|
||||
{ "command" , _command },
|
||||
{ "callback" , _callback },
|
||||
|
||||
Reference in New Issue
Block a user