redesign connection module

This commit is contained in:
云风
2012-08-14 22:37:30 +08:00
parent 4b3ce3ba5b
commit 4a0265020f
13 changed files with 466 additions and 705 deletions

View File

@@ -275,7 +275,7 @@ _remote_harbor_update(int harbor_id, const char * addr) {
void *socket = zmq_socket( Z->zmq_context, ZMQ_PUSH);
int rc = zmq_connect(socket, addr);
if (rc<0) {
skynet_error(NULL, "Can't connect to %d %s",harbor_id,addr);
skynet_error(NULL, "Can't connect to harbor %d %s",harbor_id,addr);
zmq_close(socket);
socket = NULL;
}

View File

@@ -399,6 +399,9 @@ skynet_send(struct skynet_context * context, const char * source, const char * a
session = skynet_context_newsession(context);
session_id = - session;
}
if (addr == NULL) {
return session;
}
uint32_t des = 0;
if (addr[0] == ':') {
des = strtoul(addr+1, NULL, 16);