support multi protocol

This commit is contained in:
云风
2012-08-31 21:18:19 +08:00
parent 1ee802c5c5
commit 0a886cd57c
47 changed files with 542 additions and 520 deletions

View File

@@ -1,3 +1,4 @@
#include "skynet.h"
#include "skynet_harbor.h"
#include "skynet_server.h"
@@ -10,7 +11,10 @@ static int HARBOR = 0;
void
skynet_harbor_send(struct remote_message *rmsg, uint32_t source, int session) {
skynet_context_send(REMOTE, rmsg, sizeof(*rmsg), source, session);
int type = rmsg->sz >> 24;
rmsg->sz &= 0xffffff;
assert(type != PTYPE_SYSTEM && type != PTYPE_HARBOR);
skynet_context_send(REMOTE, rmsg, sizeof(*rmsg) , source, type , session);
}
void
@@ -25,7 +29,7 @@ skynet_harbor_register(struct remote_name *rname) {
}
}
assert(number == 0);
skynet_context_send(REMOTE, rname, sizeof(*rname), 0, 0);
skynet_context_send(REMOTE, rname, sizeof(*rname), 0, PTYPE_SYSTEM , 0);
}
int