12 #ifndef TCPIP_CONNECTION_H
13 #define TCPIP_CONNECTION_H
15 #include <tr1/cstdint>
17 #include <arpa/inet.h>
18 #include <netinet/in.h>
85 #endif // #ifndef TCPIP_CONNECTION_H
virtual ~TCPIPConnection()
Destructor.
TCPIP server that accepts client connections.
Definition: tcpip_server.h:30
Connection class - declarations.
TCPIPConnection & operator=(const TCPIPConnection &)
TCP/IP connection.
Definition: tcpip_connection.h:30
static const size_t DEFAULT_LENGTH_FIELD_BUFFER_SIZE
Default buffer size used when receiving a message via length_field.
Definition: tcpip_connection.h:82
virtual size_t doSendMessage(const std::string &message)
Sends the selected message.
TCPIPConfig class - declarations.
TCPIPConnection(int socket, sockaddr_in socketInfo, const TCPIPConfig &config)
Constructor.
std::string getAddress() const
Returns IPv4 address of the connected node.
unsigned getPort() const
Returns port number through which the connected node is connected.
sockaddr_in _socketInfo
Socket information.
Definition: tcpip_connection.h:78
Configuration for a TCP/IP server.
Definition: tcpip_config.h:30
std::tr1::uint32_t LengthFieldMessageLength
Message length type when using length field.
Definition: config.h:49
virtual void close()
Closes an established TCP connection.
virtual std::string doReceiveMessage(Config::LengthFieldMessageLength messageLength)
Receives a message.
Abstract class for all connection types.
Definition: connection.h:28
int _socket
Connection socket.
Definition: tcpip_connection.h:76