Loading ndb/include/transporter/TransporterRegistry.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,8 @@ public: }; Vector<Transporter_interface> m_transporter_interface; void add_transporter_interface(const char *interf, unsigned short port); struct in_addr get_connect_address(NodeId node_id) const; protected: private: Loading ndb/src/common/transporter/Transporter.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ Transporter::Transporter(TransporterRegistry &t_reg, m_connected = false; m_timeOutMillis = 1000; m_connect_address.s_addr= 0; if (isServer) m_socket_client= 0; else Loading @@ -98,6 +99,13 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { DBUG_RETURN(true); // TODO assert(0); } { struct sockaddr addr; SOCKET_SIZE_TYPE addrlen= sizeof(addr); int r= getpeername(sockfd, &addr, &addrlen); m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr; } bool res = connect_server_impl(sockfd); if(res){ m_connected = true; Loading Loading @@ -164,6 +172,13 @@ Transporter::connect_client() { g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId); } { struct sockaddr addr; SOCKET_SIZE_TYPE addrlen= sizeof(addr); int r= getpeername(sockfd, &addr, &addrlen); m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr; } bool res = connect_client_impl(sockfd); if(res){ m_connected = true; Loading ndb/src/common/transporter/Transporter.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ protected: private: SocketClient *m_socket_client; struct in_addr m_connect_address; protected: Uint32 getErrorCount(); Loading ndb/src/common/transporter/TransporterRegistry.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,12 @@ extern int g_ndb_shm_signum; #include <EventLogger.hpp> extern EventLogger g_eventLogger; struct in_addr TransporterRegistry::get_connect_address(NodeId node_id) const { return theTransporters[node_id]->m_connect_address; } SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) { DBUG_ENTER("SocketServer::Session * TransporterService::newSession"); Loading ndb/src/mgmsrv/MgmtSrvr.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -2124,6 +2124,24 @@ MgmtSrvr::getNodeType(NodeId nodeId) const return nodeTypes[nodeId]; } const char *MgmtSrvr::get_connect_address(Uint32 node_id) { if (m_connect_address[node_id].s_addr == 0 && theFacade && theFacade->theTransporterRegistry && theFacade->theClusterMgr && getNodeType(node_id) == NDB_MGM_NODE_TYPE_NDB) { const ClusterMgr::Node &node= theFacade->theClusterMgr->getNodeInfo(node_id); if (node.connected) { m_connect_address[node_id]= theFacade->theTransporterRegistry->get_connect_address(node_id); } } return inet_ntoa(m_connect_address[node_id]); } void MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const { Loading Loading
ndb/include/transporter/TransporterRegistry.hpp +2 −0 Original line number Diff line number Diff line Loading @@ -238,6 +238,8 @@ public: }; Vector<Transporter_interface> m_transporter_interface; void add_transporter_interface(const char *interf, unsigned short port); struct in_addr get_connect_address(NodeId node_id) const; protected: private: Loading
ndb/src/common/transporter/Transporter.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ Transporter::Transporter(TransporterRegistry &t_reg, m_connected = false; m_timeOutMillis = 1000; m_connect_address.s_addr= 0; if (isServer) m_socket_client= 0; else Loading @@ -98,6 +99,13 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { DBUG_RETURN(true); // TODO assert(0); } { struct sockaddr addr; SOCKET_SIZE_TYPE addrlen= sizeof(addr); int r= getpeername(sockfd, &addr, &addrlen); m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr; } bool res = connect_server_impl(sockfd); if(res){ m_connected = true; Loading Loading @@ -164,6 +172,13 @@ Transporter::connect_client() { g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId); } { struct sockaddr addr; SOCKET_SIZE_TYPE addrlen= sizeof(addr); int r= getpeername(sockfd, &addr, &addrlen); m_connect_address= ((struct sockaddr_in *)&addr)->sin_addr; } bool res = connect_client_impl(sockfd); if(res){ m_connected = true; Loading
ndb/src/common/transporter/Transporter.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ protected: private: SocketClient *m_socket_client; struct in_addr m_connect_address; protected: Uint32 getErrorCount(); Loading
ndb/src/common/transporter/TransporterRegistry.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,12 @@ extern int g_ndb_shm_signum; #include <EventLogger.hpp> extern EventLogger g_eventLogger; struct in_addr TransporterRegistry::get_connect_address(NodeId node_id) const { return theTransporters[node_id]->m_connect_address; } SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) { DBUG_ENTER("SocketServer::Session * TransporterService::newSession"); Loading
ndb/src/mgmsrv/MgmtSrvr.cpp +18 −0 Original line number Diff line number Diff line Loading @@ -2124,6 +2124,24 @@ MgmtSrvr::getNodeType(NodeId nodeId) const return nodeTypes[nodeId]; } const char *MgmtSrvr::get_connect_address(Uint32 node_id) { if (m_connect_address[node_id].s_addr == 0 && theFacade && theFacade->theTransporterRegistry && theFacade->theClusterMgr && getNodeType(node_id) == NDB_MGM_NODE_TYPE_NDB) { const ClusterMgr::Node &node= theFacade->theClusterMgr->getNodeInfo(node_id); if (node.connected) { m_connect_address[node_id]= theFacade->theTransporterRegistry->get_connect_address(node_id); } } return inet_ntoa(m_connect_address[node_id]); } void MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const { Loading