Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
actor-incubator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
actor-incubator
Commits
9a85c891
Commit
9a85c891
authored
Aug 28, 2019
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup string usage
parent
1053a701
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
libcaf_net/test/doorman.cpp
libcaf_net/test/doorman.cpp
+8
-3
No files found.
libcaf_net/test/doorman.cpp
View file @
9a85c891
...
@@ -37,13 +37,18 @@ using namespace caf::net;
...
@@ -37,13 +37,18 @@ using namespace caf::net;
namespace
{
namespace
{
// TODO: switch to std::operator""s when switching to C++14
std
::
string
operator
""
_s
(
const
char
*
str
,
size_t
size
)
{
return
std
::
string
(
str
,
size
);
}
struct
fixture
:
test_coordinator_fixture
<>
,
host_fixture
{
struct
fixture
:
test_coordinator_fixture
<>
,
host_fixture
{
fixture
()
{
fixture
()
{
mpx
=
std
::
make_shared
<
multiplexer
>
();
mpx
=
std
::
make_shared
<
multiplexer
>
();
if
(
auto
err
=
mpx
->
init
())
if
(
auto
err
=
mpx
->
init
())
CAF_FAIL
(
"mpx->init failed: "
<<
sys
.
render
(
err
));
CAF_FAIL
(
"mpx->init failed: "
<<
sys
.
render
(
err
));
auth
.
port
=
0
;
auth
.
port
=
0
;
auth
.
host
=
std
::
string
{
"0.0.0.0"
}
;
auth
.
host
=
"0.0.0.0"
_s
;
}
}
bool
handle_io_event
()
override
{
bool
handle_io_event
()
override
{
...
@@ -126,7 +131,7 @@ CAF_TEST(tcp connect) {
...
@@ -126,7 +131,7 @@ CAF_TEST(tcp connect) {
CAF_MESSAGE
(
"opened acceptor on port "
<<
port
);
CAF_MESSAGE
(
"opened acceptor on port "
<<
port
);
uri
::
authority_type
dst
;
uri
::
authority_type
dst
;
dst
.
port
=
port
;
dst
.
port
=
port
;
dst
.
host
=
std
::
string
{
"localhost"
}
;
dst
.
host
=
"localhost"
_s
;
auto
conn
=
make_socket_guard
(
unbox
(
make_connected_tcp_stream_socket
(
dst
)));
auto
conn
=
make_socket_guard
(
unbox
(
make_connected_tcp_stream_socket
(
dst
)));
auto
accepted
=
make_socket_guard
(
unbox
(
accept
(
acceptor
)));
auto
accepted
=
make_socket_guard
(
unbox
(
accept
(
acceptor
)));
CAF_MESSAGE
(
"accepted connection"
);
CAF_MESSAGE
(
"accepted connection"
);
...
@@ -145,7 +150,7 @@ CAF_TEST(doorman accept) {
...
@@ -145,7 +150,7 @@ CAF_TEST(doorman accept) {
CAF_MESSAGE
(
"connecting to doorman"
);
CAF_MESSAGE
(
"connecting to doorman"
);
uri
::
authority_type
dst
;
uri
::
authority_type
dst
;
dst
.
port
=
port
;
dst
.
port
=
port
;
dst
.
host
=
std
::
string
{
"localhost"
}
;
dst
.
host
=
"localhost"
_s
;
auto
conn
=
make_socket_guard
(
unbox
(
make_connected_tcp_stream_socket
(
dst
)));
auto
conn
=
make_socket_guard
(
unbox
(
make_connected_tcp_stream_socket
(
dst
)));
CAF_MESSAGE
(
"waiting for connection"
);
CAF_MESSAGE
(
"waiting for connection"
);
while
(
mpx
->
num_socket_managers
()
!=
before
+
1
)
while
(
mpx
->
num_socket_managers
()
!=
before
+
1
)
...
...
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