#include <AsyncTcpConnection.h>
Definition at line 123 of file AsyncTcpConnection.h.
Reason code for disconnects.
Definition at line 129 of file AsyncTcpConnection.h.
Async::TcpConnection::TcpConnection | ( | size_t | recv_buf_len = DEFAULT_RECV_BUF_LEN |
) | [explicit] |
Constructor.
recv_buf_len | The length of the receiver buffer to use |
Async::TcpConnection::TcpConnection | ( | int | sock, | |
const IpAddress & | remote_addr, | |||
uint16_t | remote_port, | |||
size_t | recv_buf_len = DEFAULT_RECV_BUF_LEN | |||
) |
Constructor.
sock | The socket for the connection to handle | |
remote_addr | The remote IP-address of the connection | |
remote_port | The remote TCP-port of the connection | |
recv_buf_len | The length of the receiver buffer to use |
Async::TcpConnection::~TcpConnection | ( | void | ) |
Destructor.
static const char* Async::TcpConnection::disconnectReasonStr | ( | DisconnectReason | reason | ) | [static] |
Translate disconnect reason to a string.
void Async::TcpConnection::disconnect | ( | void | ) |
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
Reimplemented in Async::TcpClient.
int Async::TcpConnection::write | ( | const void * | buf, | |
int | count | |||
) |
Write data to the TCP connection.
buf | The buffer containing the data to send | |
count | The number of bytes to send from the buffer |
const IpAddress& Async::TcpConnection::remoteHost | ( | void | ) | const [inline] |
Return the IP-address of the remote host.
Definition at line 193 of file AsyncTcpConnection.h.
uint16_t Async::TcpConnection::remotePort | ( | void | ) | const [inline] |
Return the remote port used.
Definition at line 199 of file AsyncTcpConnection.h.
bool Async::TcpConnection::isConnected | ( | void | ) | const [inline] |
Check if the connection is established or not.
Definition at line 206 of file AsyncTcpConnection.h.
void Async::TcpConnection::setSocket | ( | int | sock | ) | [protected] |
Setup information about the connection.
sock | The socket for the connection to handle |
void Async::TcpConnection::setRemoteAddr | ( | const IpAddress & | remote_addr | ) | [protected] |
Setup information about the connection.
remote_addr | The remote IP-address of the connection |
void Async::TcpConnection::setRemotePort | ( | uint16_t | remote_port | ) | [protected] |
Setup information about the connection.
remote_port | The remote TCP-port of the connection |
int Async::TcpConnection::socket | ( | void | ) | const [inline, protected] |
Return the socket file descriptor.
Definition at line 271 of file AsyncTcpConnection.h.
const int Async::TcpConnection::DEFAULT_RECV_BUF_LEN = 1024 [static] |
SigC::Signal2<void, TcpConnection *, DisconnectReason> Async::TcpConnection::disconnected |
A signal that is emitted when a connection has been terminated.
con | The connection object | |
reason | The reason for the disconnect |
Definition at line 213 of file AsyncTcpConnection.h.
SigC::Signal3<int, TcpConnection *, void *, int> Async::TcpConnection::dataReceived |
A signal that is emitted when data has been received on the connection.
buf | A buffer containg the read data | |
count | The number of bytes in the buffer |
Definition at line 229 of file AsyncTcpConnection.h.
SigC::Signal1<void, bool> Async::TcpConnection::sendBufferFull |
A signal that is emitted when the send buffer status changes.
is_full | Set to true if the buffer is full or false if a buffer full condition has been cleared |
Definition at line 236 of file AsyncTcpConnection.h.