Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
code
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ReadMailReallyFast
code
Commits
87684320
Commit
87684320
authored
2 years ago
by
Benny Baumann
Browse files
Options
Downloads
Patches
Plain Diff
add: Allow binding to an interface
parent
d5de1cfd
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
First unit tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/net/tcp_server_socket.hpp
+10
-0
10 additions, 0 deletions
src/net/tcp_server_socket.hpp
with
10 additions
and
0 deletions
src/net/tcp_server_socket.hpp
+
10
−
0
View file @
87684320
...
...
@@ -56,6 +56,16 @@ public:
*/
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
* disconnects this number will be reduced. When a new client arrives this number will be incremented.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment