20 #ifndef INCLUDE_OLA_NETWORK_TCPCONNECTOR_H_
21 #define INCLUDE_OLA_NETWORK_TCPCONNECTOR_H_
24 #include <ola/Clock.h>
25 #include <ola/io/Descriptor.h>
26 #include <ola/io/SelectServerInterface.h>
29 #include <ola/network/TCPSocket.h>
45 typedef const void* TCPConnectionID;
51 bool Cancel(TCPConnectionID
id);
53 unsigned int ConnectionsPending()
const {
return m_connections.size(); }
65 : WriteFileDescriptor(),
68 timeout_id(ola::thread::INVALID_TIMEOUT),
69 m_connector(connector),
73 int WriteDescriptor()
const {
return m_fd; }
80 ola::thread::timeout_id timeout_id;
87 typedef std::set<PendingTCPConnection*> ConnectionSet;
90 ConnectionSet m_connections;
93 void SocketWritable(PendingTCPConnection *connection);
94 void FreePendingConnection(PendingTCPConnection *connection);
95 void Timeout(
const ConnectionSet::iterator &iter);
96 void TimeoutEvent(PendingTCPConnection *connection);
100 #endif // INCLUDE_OLA_NETWORK_TCPCONNECTOR_H_