Skip to content
Snippets Groups Projects
Commit 87684320 authored by Benny Baumann's avatar Benny Baumann
Browse files

add: Allow binding to an interface

parent d5de1cfd
No related branches found
No related tags found
1 merge request!1First unit tests
This commit is part of merge request !1. Comments created here will be created in the context of that merge request.
...@@ -56,6 +56,16 @@ public: ...@@ -56,6 +56,16 @@ public:
*/ */
tcp_server_socket(const socketaddr& socket_identifier, incoming_client_listener_type client_listener_); tcp_server_socket(const socketaddr& socket_identifier, incoming_client_listener_type client_listener_);
/**
* This constructor accepts an interface address and a port to bind to and the client listener that should be called when clients arrive.
* This constructor tries to guess the correct address family and interface.
* @brief Construct a TCP server that listens the specified interface
* @param interface_description The interface to bind to
* @param port The port to bind to
* @param client_listener_ The client listener to call when a client arrives.
*/
tcp_server_socket(const std::string& interface_description, const uint16_t port, incoming_client_listener_type client_listener_);
/** /**
* This method provides you with the current number of connected clients. When a client * This method provides you with the current number of connected clients. When a client
* disconnects this number will be reduced. When a new client arrives this number will be incremented. * disconnects this number will be reduced. When a new client arrives this number will be incremented.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment