20 #ifndef INCLUDE_OLA_NETWORK_ADVANCEDTCPCONNECTOR_H_
21 #define INCLUDE_OLA_NETWORK_ADVANCEDTCPCONNECTOR_H_
26 #include <ola/io/SelectServerInterface.h>
27 #include <ola/network/TCPConnector.h>
28 #include <ola/network/TCPSocketFactory.h>
29 #include <ola/util/Backoff.h>
58 unsigned int EndpointCount()
const {
return m_connections.size(); }
60 enum ConnectionState {
67 ConnectionState *connected,
68 unsigned int *failed_attempts)
const;
75 ConnectionState state;
76 unsigned int failed_attempts;
77 ola::thread::timeout_id retry_timeout;
78 TCPConnector::TCPConnectionID connection_id;
82 typedef std::pair<IPV4Address, uint16_t> IPPortPair;
101 typedef std::map<IPPortPair, ConnectionInfo*> ConnectionMap;
102 ConnectionMap m_connections;
104 void RetryTimeout(IPPortPair key);
105 void ConnectionResult(IPPortPair key,
int fd,
int error);
106 void AttemptConnection(
const IPPortPair &key,
ConnectionInfo *state);
111 #endif // INCLUDE_OLA_NETWORK_ADVANCEDTCPCONNECTOR_H_