mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
add log for net building
This commit is contained in:
@@ -245,6 +245,8 @@ _connect_to(struct harbor *h, const char *ipaddress, bool blocking) {
|
|||||||
|
|
||||||
int portid = strtol(port+1, NULL,10);
|
int portid = strtol(port+1, NULL,10);
|
||||||
|
|
||||||
|
skynet_error(h->ctx, "Harbor(%d) connect to %s:%d", h->id, tmp, portid);
|
||||||
|
|
||||||
if (blocking) {
|
if (blocking) {
|
||||||
return skynet_socket_block_connect(h->ctx, tmp, portid);
|
return skynet_socket_block_connect(h->ctx, tmp, portid);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -196,6 +196,13 @@ skynet_start(struct skynet_config * config) {
|
|||||||
skynet_timer_init();
|
skynet_timer_init();
|
||||||
skynet_socket_init();
|
skynet_socket_init();
|
||||||
|
|
||||||
|
struct skynet_context *ctx;
|
||||||
|
ctx = skynet_context_new("logger", config->logger);
|
||||||
|
if (ctx == NULL) {
|
||||||
|
fprintf(stderr,"launch logger error");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (config->standalone) {
|
if (config->standalone) {
|
||||||
if (_start_master(config->standalone)) {
|
if (_start_master(config->standalone)) {
|
||||||
fprintf(stderr, "Init fail : mater");
|
fprintf(stderr, "Init fail : mater");
|
||||||
@@ -208,12 +215,6 @@ skynet_start(struct skynet_config * config) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct skynet_context *ctx;
|
|
||||||
ctx = skynet_context_new("logger", config->logger);
|
|
||||||
if (ctx == NULL) {
|
|
||||||
fprintf(stderr,"launch logger error");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
ctx = skynet_context_new("localcast", NULL);
|
ctx = skynet_context_new("localcast", NULL);
|
||||||
if (ctx == NULL) {
|
if (ctx == NULL) {
|
||||||
fprintf(stderr,"launch local cast error");
|
fprintf(stderr,"launch local cast error");
|
||||||
|
|||||||
Reference in New Issue
Block a user