add harbor query api

This commit is contained in:
云风
2012-08-30 17:52:44 +08:00
parent 4610781498
commit 161528e686
5 changed files with 31 additions and 0 deletions

View File

@@ -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);

View File

@@ -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) {