This commit is contained in:
云风
2013-12-09 17:54:46 +08:00
parent 340148c152
commit f7242294dd
6 changed files with 128 additions and 22 deletions

View File

@@ -11,8 +11,8 @@
#define PTYPE_SYSTEM 4
#define PTYPE_HARBOR 5
#define PTYPE_SOCKET 6
// don't use these id
#define PTYPE_RESERVED_0 7
// read lualib/skynet.lua lualib/simplemonitor.lua
#define PTYPE_EXIT 7
// read lualib/skynet.lua lualib/mqueue.lua
#define PTYPE_RESERVED_QUEUE 8
#define PTYPE_RESERVED_DEBUG 9

View File

@@ -540,7 +540,12 @@ skynet_command(struct skynet_context * context, const char * cmd , const char *
if (strcmp(cmd,"MONITOR") == 0) {
uint32_t handle=0;
if (param == NULL || param[0] == '\0') {
handle = context->handle;
if (G_NODE.monitor_exit) {
// return current monitor serivce
sprintf(context->result, ":%x", G_NODE.monitor_exit);
return context->result;
}
return NULL;
} else {
if (param[0] == ':') {
handle = strtoul(param+1, NULL, 16);