diff --git a/src/sofa/pbrpc/rpc_listener.h b/src/sofa/pbrpc/rpc_listener.h index ac0f0e8..5dcab57 100644 --- a/src/sofa/pbrpc/rpc_listener.h +++ b/src/sofa/pbrpc/rpc_listener.h @@ -33,7 +33,7 @@ class RpcListener : public sofa::pbrpc::enable_shared_from_this , _endpoint(endpoint) , _endpoint_str(RpcEndpointToString(endpoint)) , _acceptor(io_service) - , _is_closed(false) + , _is_closed(true) { SOFA_PBRPC_INC_RESOURCE_COUNTER(RpcListener); } @@ -152,6 +152,7 @@ class RpcListener : public sofa::pbrpc::enable_shared_from_this #else SLOG(INFO, "start_listen(): listen succeed: %s", _endpoint_str.c_str()); #endif + _is_closed = false; async_accept();