Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
05b1ba8b
Commit
05b1ba8b
authored
Nov 07, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the default max number of connections a server will accept at a
time to 1000 rather than the previous default of infinity.
parent
4c3578dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
server_kernel_1.h
dlib/server/server_kernel_1.h
+4
-4
server_kernel_abstract.h
dlib/server/server_kernel_abstract.h
+6
-5
No files found.
dlib/server/server_kernel_1.h
View file @
05b1ba8b
...
...
@@ -46,7 +46,7 @@ namespace dlib
thread_count_mutex == a mutex
thread_count_signaler == a signaler associated with thread_count_mutex
thread_count_zero == a signaler associated with thread_count_mutex
max_connections ==
0
max_connections ==
1000
max_connections_mutex == a mutex for max_connections
CONVENTION
...
...
@@ -217,7 +217,7 @@ namespace dlib
running_signaler
(
running_mutex
),
thread_count
(
0
),
thread_count_signaler
(
thread_count_mutex
),
max_connections
(
0
),
max_connections
(
100
0
),
thread_count_zero
(
thread_count_mutex
)
{
}
...
...
@@ -285,7 +285,7 @@ namespace dlib
listening_ip_mutex
.
lock
();
listening_ip
=
""
;
listening_port
=
0
;
max_connections
=
0
;
max_connections
=
100
0
;
listening_port_mutex
.
unlock
();
listening_ip_mutex
.
unlock
();
max_connections_mutex
.
unlock
();
...
...
@@ -393,7 +393,7 @@ namespace dlib
listening_ip_mutex
.
lock
();
listening_ip
=
""
;
listening_port
=
0
;
max_connections
=
0
;
max_connections
=
100
0
;
listening_port_mutex
.
unlock
();
listening_ip_mutex
.
unlock
();
max_connections_mutex
.
unlock
();
...
...
dlib/server/server_kernel_abstract.h
View file @
05b1ba8b
...
...
@@ -21,7 +21,7 @@ namespace dlib
get_listening_ip() == ""
get_listening_port() == 0
is_running() == false
get_max_connections() == 0
get_max_connections() ==
100
0
CALLBACK FUNCTIONS
...
...
@@ -53,9 +53,10 @@ namespace dlib
Also note that when clear() is called all open connection objects
will be shutdown().
A note about get_max_connections(). When the maximum number of
connections has been reached accept() will simply not be called
until the number of open connections drops below get_max_connections()
A note about get_max_connections(): when the maximum number of connections
has been reached accept() will simply not be called until the number of
open connections drops below get_max_connections(). This means connections
will just wait to be serviced, rather than being outright refused.
THREAD SAFETY
All member functions are thread-safe.
...
...
@@ -179,7 +180,7 @@ namespace dlib
/*!
ensures
- returns the maximum number of connections the server will accept
at a time
at a time
.
- returns 0 if the server will accept any number of connections
throws
- std::bad_alloc
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment