diff --git a/src/adapter/adapter.c b/src/adapter/adapter.c index 77f1bae5e..12fd26400 100644 --- a/src/adapter/adapter.c +++ b/src/adapter/adapter.c @@ -124,8 +124,8 @@ neu_adapter_t *neu_adapter_create(neu_adapter_info_t *info) rv = nng_pair1_open(&adapter->sock); assert(rv == 0); - nng_socket_set_int(adapter->sock, NNG_OPT_RECVBUF, 2048); - nng_socket_set_int(adapter->sock, NNG_OPT_SENDBUF, 2048); + nng_socket_set_int(adapter->sock, NNG_OPT_RECVBUF, 8192); + nng_socket_set_int(adapter->sock, NNG_OPT_SENDBUF, 8192); nng_socket_set_ms(adapter->sock, NNG_OPT_SENDTIMEO, 1000); nng_socket_get_int(adapter->sock, NNG_OPT_RECVFD, &adapter->recv_fd); diff --git a/src/core/manager.c b/src/core/manager.c index 216d9ff34..ff5e3dc1b 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -99,6 +99,7 @@ neu_manager_t *neu_manager_create() nng_socket_set_int(manager->socket, NNG_OPT_RECVBUF, 8192); nng_socket_set_int(manager->socket, NNG_OPT_SENDBUF, 8292); + nng_socket_set_ms(manager->socket, NNG_OPT_SENDTIMEO, 1000); nng_socket_get_int(manager->socket, NNG_OPT_RECVFD, ¶m.fd); manager->loop = neu_event_add_io(manager->events, param); @@ -731,6 +732,7 @@ inline static void forward_msg_dup(neu_manager_t *manager, nng_msg *msg, if (nng_sendmsg(manager->socket, out_msg, 0) == 0) { nlog_debug("forward msg to pipe %d", pipe.id); } else { + nlog_warn("forward msg to pipe %d fail", pipe.id); nng_msg_free(out_msg); } } @@ -746,6 +748,7 @@ inline static void forward_msg(neu_manager_t *manager, nng_msg *msg, if (nng_sendmsg(manager->socket, out_msg, 0) == 0) { nlog_debug("forward msg to %s", node); } else { + nlog_warn("forward msg to pipe (%s)%d fail", node, pipe.id); nng_msg_free(out_msg); } }