21 #include <ndb_global.h>
23 #include <SocketClient.hpp>
25 #include <TransporterRegistry.hpp>
26 #include <TransporterCallback.hpp>
27 #include "TransporterDefinitions.hpp"
31 #include <NdbThread.h>
33 #include <ndb_socket.h>
38 virtual bool initTransporter() = 0;
86 m_socket_client->set_port(port);
89 void update_status_overloaded(Uint32 used)
92 used >= m_overload_limit);
95 virtual int doSend() = 0;
97 bool has_data_to_send()
103 Uint32 get_max_send_buffer() {
return m_max_send_buffer; }
108 const char *lHostName,
109 const char *rHostName,
111 bool isMgmConnection,
119 Uint32 max_send_buffer);
129 virtual bool connect_client_impl(NDB_SOCKET_TYPE sockfd) = 0;
130 virtual int pre_connect_options(NDB_SOCKET_TYPE sockfd) {
return 0;}
141 char localHostName[256];
142 struct in_addr remoteHostAddress;
143 struct in_addr localHostAddress;
147 const NodeId remoteNodeId;
148 const NodeId localNodeId;
152 unsigned createIndex;
155 bool compressionUsed;
159 Uint32 m_max_send_buffer;
161 Uint32 m_overload_limit;
169 bool isMgmConnection;
172 struct in_addr m_connect_address;
174 virtual bool send_is_possible(
int timeout_millisec)
const = 0;
175 virtual bool send_limit_reached(
int bufsize) = 0;
178 Uint32 m_os_max_iovec;
179 Uint32 m_timeOutMillis;
181 TransporterType m_type;
185 void do_disconnect(
int err){m_transporter_registry.
do_disconnect(remoteNodeId,err);};
186 void report_error(
enum TransporterError err,
const char *info = 0)
187 { m_transporter_registry.
report_error(remoteNodeId, err, info); };
190 void iovec_data_sent(
int nBytesSent);
225 Transporter::iovec_data_sent(
int nBytesSent)
228 = get_callback_obj()->
bytes_sent(remoteNodeId, nBytesSent);
229 update_status_overloaded(used_bytes);
232 #endif // Define of Transporter_H