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
ea77f761
Commit
ea77f761
authored
Jun 15, 2020
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary move, cleanup resolve
parent
ff2dca97
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
16 deletions
+6
-16
libcaf_net/caf/net/backend/tcp.hpp
libcaf_net/caf/net/backend/tcp.hpp
+2
-2
libcaf_net/src/net/backend/tcp.cpp
libcaf_net/src/net/backend/tcp.cpp
+4
-14
No files found.
libcaf_net/caf/net/backend/tcp.hpp
View file @
ea77f761
...
@@ -87,10 +87,10 @@ public:
...
@@ -87,10 +87,10 @@ public:
emplace_return_type
res
;
emplace_return_type
res
;
{
{
const
std
::
lock_guard
<
std
::
mutex
>
lock
(
lock_
);
const
std
::
lock_guard
<
std
::
mutex
>
lock
(
lock_
);
res
=
peers_
.
emplace
(
peer_id
,
mgr
);
res
=
peers_
.
emplace
(
peer_id
,
std
::
move
(
mgr
)
);
}
}
if
(
res
.
second
)
if
(
res
.
second
)
return
std
::
move
(
mgr
)
;
return
res
.
first
->
second
;
else
else
return
make_error
(
sec
::
runtime_error
,
"peer_id already exists"
);
return
make_error
(
sec
::
runtime_error
,
"peer_id already exists"
);
}
}
...
...
libcaf_net/src/net/backend/tcp.cpp
View file @
ea77f761
...
@@ -109,20 +109,10 @@ endpoint_manager_ptr tcp::peer(const node_id& id) {
...
@@ -109,20 +109,10 @@ endpoint_manager_ptr tcp::peer(const node_id& id) {
}
}
void
tcp
::
resolve
(
const
uri
&
locator
,
const
actor
&
listener
)
{
void
tcp
::
resolve
(
const
uri
&
locator
,
const
actor
&
listener
)
{
if
(
auto
id
=
locator
.
authority_only
())
{
if
(
auto
p
=
get_or_connect
(
locator
))
auto
p
=
peer
(
make_node_id
(
*
id
));
(
*
p
)
->
resolve
(
locator
,
listener
);
if
(
p
==
nullptr
)
{
CAF_LOG_INFO
(
"connecting to "
<<
CAF_ARG
(
locator
));
auto
res
=
get_or_connect
(
locator
);
if
(
!
res
)
anon_send
(
listener
,
error
(
sec
::
cannot_connect_to_node
));
else
else
p
=
*
res
;
anon_send
(
listener
,
p
.
error
());
}
p
->
resolve
(
locator
,
listener
);
}
else
{
anon_send
(
listener
,
error
(
basp
::
ec
::
invalid_locator
));
}
}
}
strong_actor_ptr
tcp
::
make_proxy
(
node_id
nid
,
actor_id
aid
)
{
strong_actor_ptr
tcp
::
make_proxy
(
node_id
nid
,
actor_id
aid
)
{
...
...
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