mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
add harbor query api
This commit is contained in:
@@ -18,6 +18,7 @@ int skynet_send(struct skynet_context * context, uint32_t source, uint32_t desti
|
||||
int skynet_sendname(struct skynet_context * context, const char * destination , int session, void * msg, size_t sz, int flags);
|
||||
|
||||
void skynet_forward(struct skynet_context *, uint32_t destination);
|
||||
int skynet_isremote(struct skynet_context *, uint32_t handle, int * harbor);
|
||||
|
||||
typedef int (*skynet_cb)(struct skynet_context * context, void *ud, int session, uint32_t source , const void * msg, size_t sz);
|
||||
void skynet_callback(struct skynet_context * context, void *ud, skynet_cb cb);
|
||||
|
||||
@@ -153,6 +153,15 @@ skynet_context_push(uint32_t handle, struct skynet_message *message) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
skynet_isremote(struct skynet_context * ctx, uint32_t handle, int * harbor) {
|
||||
int ret = skynet_harbor_message_isremote(handle);
|
||||
if (harbor) {
|
||||
*harbor = (int)(handle >> HANDLE_REMOTE_SHIFT);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
_forwarding(struct skynet_context *ctx, struct skynet_message *msg) {
|
||||
if (ctx->forward) {
|
||||
|
||||
Reference in New Issue
Block a user