mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
skynet.forward
This commit is contained in:
@@ -229,6 +229,15 @@ _redirect(lua_State *L) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_forward(lua_State *L) {
|
||||||
|
struct skynet_context * context = lua_touserdata(L, lua_upvalueindex(1));
|
||||||
|
uint32_t dest = luaL_checkunsigned(L,1);
|
||||||
|
skynet_forward(context, dest);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
_error(lua_State *L) {
|
_error(lua_State *L) {
|
||||||
struct skynet_context * context = lua_touserdata(L, lua_upvalueindex(1));
|
struct skynet_context * context = lua_touserdata(L, lua_upvalueindex(1));
|
||||||
@@ -276,6 +285,7 @@ luaopen_skynet_c(lua_State *L) {
|
|||||||
{ "send" , _send },
|
{ "send" , _send },
|
||||||
{ "genid", _genid },
|
{ "genid", _genid },
|
||||||
{ "redirect", _redirect },
|
{ "redirect", _redirect },
|
||||||
|
{ "forward", _forward },
|
||||||
{ "command" , _command },
|
{ "command" , _command },
|
||||||
{ "callback" , _callback },
|
{ "callback" , _callback },
|
||||||
{ "error", _error },
|
{ "error", _error },
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ function skynet.send(addr, typename, ...)
|
|||||||
end
|
end
|
||||||
|
|
||||||
skynet.genid = assert(c.genid)
|
skynet.genid = assert(c.genid)
|
||||||
|
skynet.forward = assert(c.forward)
|
||||||
|
|
||||||
skynet.redirect = function(dest,source,typename,...)
|
skynet.redirect = function(dest,source,typename,...)
|
||||||
return c.redirect(dest, source, proto[typename].id, ...)
|
return c.redirect(dest, source, proto[typename].id, ...)
|
||||||
|
|||||||
Reference in New Issue
Block a user