From f21394beef9442b4420aeacf322273afd0493afa Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Thu, 14 Sep 2006 11:57:15 +0200 Subject: [PATCH] ndb - bug#22195 also bind client to local host name if specified --- ndb/src/common/transporter/Transporter.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index 820aa4cfc18..383456f1077 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -60,9 +60,6 @@ Transporter::Transporter(TransporterRegistry &t_reg, } strncpy(localHostName, lHostName, sizeof(localHostName)); - if (strlen(lHostName) > 0) - Ndb_getInAddr(&localHostAddress, lHostName); - DBUG_PRINT("info",("rId=%d lId=%d isServer=%d rHost=%s lHost=%s s_port=%d", remoteNodeId, localNodeId, isServer, remoteHostName, localHostName, @@ -128,10 +125,23 @@ Transporter::connect_client() { return true; if(isMgmConnection) + { sockfd= m_transporter_registry.connect_ndb_mgmd(m_socket_client); + } else + { + if (!m_socket_client->init()) + { + return false; + } + if (strlen(localHostName) > 0) + { + if (m_socket_client->bind(localHostName, 0) != 0) + return false; + } sockfd= m_socket_client->connect(); - + } + return connect_client(sockfd); }