add QUERY command to query local service address

This commit is contained in:
云风
2013-07-29 21:05:03 +08:00
parent f58206f6c2
commit ba22224a4a
3 changed files with 18 additions and 4 deletions

View File

@@ -384,6 +384,15 @@ skynet_command(struct skynet_context * context, const char * cmd , const char *
}
}
if (strcmp(cmd,"QUERY") == 0) {
if (param[0] == '.') {
uint32_t handle = skynet_handle_findname(param+1);
sprintf(context->result, ":%x", handle);
return context->result;
}
return NULL;
}
if (strcmp(cmd,"NAME") == 0) {
int size = strlen(param);
char name[size+1];