Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
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
Operations
Operations
Metrics
Environments
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 Framework
Commits
b0a4fdff
Commit
b0a4fdff
authored
Jul 18, 2014
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly handle incoming connections from self
parent
3a5d23d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
src/basp_broker.cpp
src/basp_broker.cpp
+7
-0
unit_testing/test_remote_actor.cpp
unit_testing/test_remote_actor.cpp
+6
-1
No files found.
src/basp_broker.cpp
View file @
b0a4fdff
...
@@ -347,6 +347,13 @@ basp_broker::handle_basp_header(connection_context& ctx,
...
@@ -347,6 +347,13 @@ basp_broker::handle_basp_header(connection_context& ctx,
return
close_connection
;
return
close_connection
;
}
}
auto
nid
=
ctx
.
handshake_data
->
remote_id
;
auto
nid
=
ctx
.
handshake_data
->
remote_id
;
if
(
nid
==
node
())
{
CAF_LOG_INFO
(
"incoming connection from self: drop connection"
);
auto
res
=
detail
::
singletons
::
get_actor_registry
()
->
get
(
remote_aid
);
ctx
.
handshake_data
->
result
->
set_value
(
std
::
move
(
res
));
ctx
.
handshake_data
=
nullptr
;
return
close_connection
;
}
if
(
!
try_set_default_route
(
nid
,
ctx
.
hdl
))
{
if
(
!
try_set_default_route
(
nid
,
ctx
.
hdl
))
{
CAF_LOG_INFO
(
"multiple connections to "
CAF_LOG_INFO
(
"multiple connections to "
<<
to_string
(
nid
)
<<
to_string
(
nid
)
...
...
unit_testing/test_remote_actor.cpp
View file @
b0a4fdff
...
@@ -319,6 +319,8 @@ void test_remote_actor(std::string app_path, bool run_remote_actor) {
...
@@ -319,6 +319,8 @@ void test_remote_actor(std::string app_path, bool run_remote_actor) {
do
{
do
{
try
{
try
{
io
::
publish
(
serv
,
port
,
"127.0.0.1"
);
io
::
publish
(
serv
,
port
,
"127.0.0.1"
);
auto
serv2
=
io
::
remote_actor
(
"127.0.0.1"
,
port
);
CAF_CHECK
(
serv
==
serv2
);
success
=
true
;
success
=
true
;
CAF_PRINT
(
"running on port "
<<
port
);
CAF_PRINT
(
"running on port "
<<
port
);
CAF_LOGF_INFO
(
"running on port "
<<
port
);
CAF_LOGF_INFO
(
"running on port "
<<
port
);
...
@@ -391,7 +393,10 @@ int main(int argc, char** argv) {
...
@@ -391,7 +393,10 @@ int main(int argc, char** argv) {
CAF_PRINT
(
"don't run remote actor (server mode)"
);
CAF_PRINT
(
"don't run remote actor (server mode)"
);
test_remote_actor
(
argv
[
0
],
false
);
test_remote_actor
(
argv
[
0
],
false
);
},
},
on
()
>>
[
&
]
{
test_remote_actor
(
argv
[
0
],
true
);
},
others
()
>>
[
&
]
{
on
()
>>
[
&
]
{
test_remote_actor
(
argv
[
0
],
true
);
},
others
()
>>
[
&
]
{
CAF_PRINTERR
(
"usage: "
<<
argv
[
0
]
<<
" [-s|-c PORT]"
);
CAF_PRINTERR
(
"usage: "
<<
argv
[
0
]
<<
" [-s|-c PORT]"
);
}
}
});
});
...
...
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