@@ -16,7 +16,10 @@ RpcChannel::RpcChannel(RpcClient* rpc_client,
1616 const RpcChannelOptions& options)
1717 : _impl(new SimpleRpcChannelImpl(rpc_client->impl (), server_address, options))
1818{
19- _impl->Init ();
19+ if (options.create_with_init )
20+ {
21+ _impl->Init ();
22+ }
2023}
2124
2225RpcChannel::RpcChannel (RpcClient* rpc_client,
@@ -27,23 +30,37 @@ RpcChannel::RpcChannel(RpcClient* rpc_client,
2730 std::ostringstream os;
2831 os << server_ip << " :" << server_port;
2932 _impl.reset (new SimpleRpcChannelImpl (rpc_client->impl (), os.str (), options));
30- _impl->Init ();
33+ if (options.create_with_init )
34+ {
35+ _impl->Init ();
36+ }
3137}
3238
3339RpcChannel::RpcChannel (RpcClient* rpc_client,
3440 const std::vector<std::string>& address_list,
3541 const RpcChannelOptions& options)
3642 : _impl(new DynamicRpcChannelImpl(rpc_client->impl (), address_list, options))
3743{
38- _impl->Init ();
44+ if (options.create_with_init )
45+ {
46+ _impl->Init ();
47+ }
3948}
4049
4150RpcChannel::RpcChannel (RpcClient* rpc_client,
4251 AddressProvider* address_provider,
4352 const RpcChannelOptions& options)
4453 : _impl(new DynamicRpcChannelImpl(rpc_client->impl (), address_provider, options))
4554{
46- _impl->Init ();
55+ if (options.create_with_init )
56+ {
57+ _impl->Init ();
58+ }
59+ }
60+
61+ bool RpcChannel::Init ()
62+ {
63+ return _impl->Init ();
4764}
4865
4966RpcChannel::~RpcChannel ()
0 commit comments