Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
6bbb3bce
Commit
6bbb3bce
authored
Nov 25, 2012
by
Davis King
Browse files
Made test a little more robust
parent
2b7a3627
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
dlib/test/iosockstream.cpp
dlib/test/iosockstream.cpp
+12
-0
No files found.
dlib/test/iosockstream.cpp
View file @
6bbb3bce
...
@@ -97,12 +97,18 @@ namespace
...
@@ -97,12 +97,18 @@ namespace
void
test1
()
void
test1
()
{
{
dlog
<<
LINFO
<<
"in test1()"
;
serv
theserv
;
serv
theserv
;
theserv
.
set_listening_port
(
12345
);
theserv
.
set_listening_port
(
12345
);
theserv
.
start_async
();
theserv
.
start_async
();
// wait a little bit to make sure the server has started listening before we try
// to connect to it.
dlib
::
sleep
(
500
);
for
(
int
i
=
0
;
i
<
1001
;
++
i
)
for
(
int
i
=
0
;
i
<
1001
;
++
i
)
{
{
dlog
<<
LINFO
<<
"i: "
<<
i
;
print_spinner
();
print_spinner
();
iosockstream
stream
(
"localhost:12345"
);
iosockstream
stream
(
"localhost:12345"
);
...
@@ -127,12 +133,18 @@ namespace
...
@@ -127,12 +133,18 @@ namespace
void
test2
()
void
test2
()
{
{
dlog
<<
LINFO
<<
"in test2()"
;
serv2
theserv
;
serv2
theserv
;
theserv
.
set_listening_port
(
12345
);
theserv
.
set_listening_port
(
12345
);
theserv
.
start_async
();
theserv
.
start_async
();
// wait a little bit to make sure the server has started listening before we try
// to connect to it.
dlib
::
sleep
(
500
);
for
(
int
i
=
0
;
i
<
1001
;
++
i
)
for
(
int
i
=
0
;
i
<
1001
;
++
i
)
{
{
dlog
<<
LINFO
<<
"i: "
<<
i
;
print_spinner
();
print_spinner
();
iosockstream
stream
(
"localhost:12345"
);
iosockstream
stream
(
"localhost:12345"
);
...
...
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