BewareMyPower commented on issue #7327:
URL: https://github.com/apache/pulsar/issues/7327#issuecomment-723920787


   Please try with following diff and take a look again
   
   ```diff
   diff --git a/pulsar-client-cpp/lib/ClientConnection.cc 
b/pulsar-client-cpp/lib/ClientConnection.cc
   index 22cc420..824d54a 100644
   --- a/pulsar-client-cpp/lib/ClientConnection.cc
   +++ b/pulsar-client-cpp/lib/ClientConnection.cc
   @@ -340,9 +340,15 @@ void ClientConnection::handleTcpConnected(const 
boost::system::error_code& err,
                                              tcp::resolver::iterator 
endpointIterator) {
        if (!err) {
            std::stringstream cnxStringStream;
   -        cnxStringStream << "[" << socket_->local_endpoint() << " -> " << 
socket_->remote_endpoint() << "] ";
   -        cnxString_ = cnxStringStream.str();
   -
   +        try {
   +            cnxStringStream << "[" << socket_->local_endpoint() << " -> " 
<< socket_->remote_endpoint()
   +                            << "] ";
   +            cnxString_ = cnxStringStream.str();
   +        } catch (const boost::system::system_error& e) {
   +            LOG_ERROR("Failed to get endpoint: " << e.what());
   +            close();
   +            return;
   +        }
            if (logicalAddress_ == physicalAddress_) {
                LOG_INFO(cnxString_ << "Connected to broker");
            } else {
   ```


----------------------------------------------------------------
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.

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


Reply via email to