Async
1.5.0
|
A class for creating a TCP client connection. More...
#include <AsyncTcpClient.h>
Public Member Functions | |
TcpClient (size_t recv_buf_len=ConT::DEFAULT_RECV_BUF_LEN) | |
Constructor. More... | |
TcpClient (const std::string &remote_host, uint16_t remote_port, size_t recv_buf_len=ConT::DEFAULT_RECV_BUF_LEN) | |
Constructor. More... | |
TcpClient (const IpAddress &remote_ip, uint16_t remote_port, size_t recv_buf_len=ConT::DEFAULT_RECV_BUF_LEN) | |
Constructor. More... | |
~TcpClient (void) | |
Destructor. More... | |
virtual void | disconnect (void) |
Disconnect from the remote host. More... | |
bool | isIdle (void) const |
Check if the connection is idle. More... | |
![]() | |
TcpClientBase (TcpConnection *con) | |
Constructor. More... | |
TcpClientBase (TcpConnection *con, const std::string &remote_host, uint16_t remote_port) | |
Constructor. More... | |
TcpClientBase (TcpConnection *con, const IpAddress &remote_ip, uint16_t remote_port) | |
Constructor. More... | |
~TcpClientBase (void) | |
Destructor. More... | |
void | bind (const IpAddress &bind_ip) |
Bind to the interface having the specified IP address. More... | |
void | connect (const std::string &remote_host, uint16_t remote_port) |
Connect to the remote host. More... | |
void | connect (const Async::IpAddress &remote_ip, uint16_t remote_port) |
Connect to the remote host. More... | |
void | connect (void) |
Connect to the remote host. More... | |
void | disconnect (void) |
Disconnect from the remote host. More... | |
bool | isIdle (void) const |
Check if the connection is idle. More... | |
Additional Inherited Members | |
![]() | |
sigc::signal< void > | connected |
A signal that is emitted when a connection has been established. More... | |
A class for creating a TCP client connection.
This class is used to create a TCP client connection. All details of how to create the connection is hidden inside the class. This make it very easy to create and use the connections. An example usage is shown below.
Definition at line 131 of file AsyncTcpClient.h.
|
inlineexplicit |
Constructor.
recv_buf_len | The length of the receiver buffer to use |
The object will be constructed and variables will be initialized but no connection will be created until the connect function (see TcpClient::connect) is called. When using this variant of the constructor the connect method which take host and port must be used.
Definition at line 144 of file AsyncTcpClient.h.
|
inline |
Constructor.
remote_host | The hostname of the remote host |
remote_port | The port on the remote host to connect to |
recv_buf_len | The length of the receiver buffer to use |
The object will be constructed and variables will be initialized but no connection will be created until the connect function (see TcpClient::connect) is called.
Definition at line 159 of file AsyncTcpClient.h.
|
inline |
Constructor.
remote_ip | The IP address of the remote host |
remote_port | The port on the remote host to connect to |
recv_buf_len | The length of the receiver buffer to use |
The object will be constructed and variables will be initialized but no connection will be created until the connect function (see TcpClient::connect) is called.
Definition at line 175 of file AsyncTcpClient.h.
|
inline |
Destructor.
Definition at line 184 of file AsyncTcpClient.h.
|
inlinevirtual |
Disconnect from the remote host.
Call this function to disconnect from the remote host. If already disconnected, nothing will be done. The disconnected signal is not emitted when this function is called
Definition at line 193 of file AsyncTcpClient.h.
References Async::TcpClientBase::disconnect().
|
inline |
Check if the connection is idle.
A connection being idle means that it is not connected nor connecting.
Definition at line 205 of file AsyncTcpClient.h.
References Async::TcpClientBase::isIdle().