mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
add QUERY command to query local service address
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user