ifplusor commented on code in PR #451:
URL: 
https://github.com/apache/rocketmq-client-cpp/pull/451#discussion_r1218992176


##########
src/transport/TcpRemotingClient.cpp:
##########
@@ -334,8 +333,9 @@ std::shared_ptr<TcpTransport> 
TcpRemotingClient::CreateTransport(const string& a
 
     //<!callback;
     TcpTransportReadCallback callback = needResponse ? 
&TcpRemotingClient::static_messageReceived : nullptr;
-
-    tts = TcpTransport::CreateTransport(this, m_enableSsl, m_sslPropertyFile, 
callback);
+    if(!tts) {
+      tts = TcpTransport::CreateTransport(this, m_enableSsl, 
m_sslPropertyFile, callback);
+    }
     TcpConnectStatus connectStatus = tts->connect(addr, 0);  // use non-block

Review Comment:
   If and only if create transport, call `connect`. watch change of status if 
status is wait.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to