Open Lighting Architecture
0.9.0
|
An class which manages non-blocking TCP connects.
Classes | |
class | PendingTCPConnection |
Public Types | |
typedef ola::SingleUseCallback2< void, int, int > | TCPConnectCallback |
typedef const void * | TCPConnectionID |
Public Member Functions | |
TCPConnector (ola::io::SelectServerInterface *ss) | |
~TCPConnector () | |
TCPConnectionID | Connect (const IPV4SocketAddress &endpoint, const ola::TimeInterval &timeout, TCPConnectCallback *callback) |
bool | Cancel (TCPConnectionID id) |
void | CancelAll () |
unsigned int | ConnectionsPending () const |
ola::network::TCPConnector::~TCPConnector | ( | ) |
Clean up
bool ola::network::TCPConnector::Cancel | ( | TCPConnectionID | id | ) |
Cancel a pending TCP connection
id | the TCPConnectionID |
void ola::network::TCPConnector::CancelAll | ( | ) |
Abort all pending TCP connections
TCPConnector::TCPConnectionID ola::network::TCPConnector::Connect | ( | const IPV4SocketAddress & | endpoint, |
const ola::TimeInterval & | timeout, | ||
TCPConnectCallback * | callback | ||
) |
Perform a non-blocking connect. on_connect may be called immediately if the address is local. on_failure will be called immediately if an error occurs
endpoint | the IPV4SocketAddress to connect to |
timeout | the time to wait before declaring the connection a failure |
callback | the callback to run when the connection completes or fails |