12 #ifndef TCPIP_SERVER_H
13 #define TCPIP_SERVER_H
16 #include <netinet/in.h>
17 #include <sys/socket.h>
135 #endif // #ifndef TCPIP_SERVER_H
IPAddresses getInterfaceAddresses(const std::string &interface)
Returns all IPv4 address associated with the selected interface.
TCPIPServer & operator=(const TCPIPServer &)
TCPIPServer(const TCPIPConfig &config)
Constructor.
TCPIPServerError(const std::string &errorMessage)
Definition: tcpip_server.h:37
TCPIP server that accepts client connections.
Definition: tcpip_server.h:30
void stopListening()
Stops listening (accepting new connections).
TCPIPConfig class - declarations.
std::vector< int > Sockets
List of sockets.
Definition: tcpip_server.h:82
static const int MAX_CONNECTION_COUNT
Maximal incoming connection count.
Definition: tcpip_server.h:132
Base exception class for all project exceptions.
Definition: base_exception.h:23
std::vector< std::string > Interfaces
List of network iterfaces.
Definition: tcpip_config.h:33
TCPIPConnection class - declarations.
Configuration for a TCP/IP server.
Definition: tcpip_config.h:30
IPAddresses getAddressesToListenOn(const TCPIPConfig::Interfaces &interfaces)
Returns a list of IPv4 address on which the server should listen on.
Sockets _sockets
List of sockets on which the server listens.
Definition: tcpip_server.h:129
std::vector< std::string > IPAddresses
List of IPv4 addresses.
Definition: tcpip_server.h:85
~TCPIPServer()
Destructor.
std::auto_ptr< TCPIPConnection > tryAcceptConnection()
Tries to accept a TCP/IP connection from a client.
This exception is thrown in case of some server error.
Definition: tcpip_server.h:35
const TCPIPConfig _config
TCP/IP configuration.
Definition: tcpip_server.h:127