new harbor

This commit is contained in:
云风
2012-08-17 11:50:45 +08:00
parent b06d380219
commit 4f6826de40
25 changed files with 331 additions and 1010 deletions

View File

@@ -56,7 +56,7 @@ _forward(struct broker *b, struct skynet_context * context) {
b->id = (b->id + 1) % DEFAULT_NUMBER;
}
static void
static int
_cb(struct skynet_context * context, void * ud, int session, const char * addr, const void * msg, size_t sz) {
struct broker * b = ud;
if (b->init < DEFAULT_NUMBER) {
@@ -68,6 +68,8 @@ _cb(struct skynet_context * context, void * ud, int session, const char * addr,
} else {
_forward(b, context);
}
return 0;
}

View File

@@ -8,7 +8,7 @@
#include <stdio.h>
#include <string.h>
static void
static int
_cb(struct skynet_context * context, void * ud, int session, const char * addr, const void * msg, size_t sz) {
assert(sz <= 65535);
int fd = (int)(intptr_t)ud;
@@ -31,7 +31,7 @@ _cb(struct skynet_context * context, void * ud, int session, const char * addr,
}
}
assert(err == sz +2);
return;
return 0;
}
}