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
47b6cbc9
Commit
47b6cbc9
authored
Oct 16, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed nullptr exception in
parent
cf31a46a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
src/default_protocol.cpp
src/default_protocol.cpp
+13
-6
src/unicast_network.cpp
src/unicast_network.cpp
+2
-1
No files found.
src/default_protocol.cpp
View file @
47b6cbc9
...
...
@@ -63,13 +63,20 @@ void default_protocol::publish(const actor_ptr& whom, variant_args args) {
CPPA_LOG_TRACE
(
"whom: "
<<
to_string
(
whom
)
<<
", args.size() = "
<<
args
.
size
());
if
(
!
whom
)
return
;
CPPA_REQUIRE
(
args
.
size
()
==
2
);
CPPA_REQUIRE
(
args
.
size
()
==
2
||
args
.
size
()
==
1
);
auto
i
=
args
.
begin
();
auto
port
=
get
<
uint16_t
>
(
*
i
++
);
auto
&
addr
=
get
<
string
>
(
*
i
);
publish
(
whom
,
unique_ptr
<
acceptor
>
(
ipv4_acceptor
::
create
(
port
,
addr
.
c_str
())),
{});
if
(
args
.
size
()
==
1
)
{
auto
port
=
get
<
uint16_t
>
(
*
i
++
);
publish
(
whom
,
unique_ptr
<
acceptor
>
(
ipv4_acceptor
::
create
(
port
,
nullptr
)),
{});
}
else
if
(
args
.
size
()
==
2
)
{
auto
port
=
get
<
uint16_t
>
(
*
i
++
);
auto
&
addr
=
get
<
string
>
(
*
i
);
publish
(
whom
,
unique_ptr
<
acceptor
>
(
ipv4_acceptor
::
create
(
port
,
addr
.
c_str
())),
{});
}
else
throw
logic_error
(
"wrong number of arguments, expected one or two"
);
}
void
default_protocol
::
publish
(
const
actor_ptr
&
whom
,
...
...
src/unicast_network.cpp
View file @
47b6cbc9
...
...
@@ -76,7 +76,8 @@ actor_ptr remote_actor(io_stream_ptr_pair io) {
}
void
publish
(
actor_ptr
whom
,
std
::
uint16_t
port
,
const
char
*
addr
)
{
proto
()
->
publish
(
whom
,
{
port
,
addr
});
if
(
!
addr
)
proto
()
->
publish
(
whom
,
{
port
});
else
proto
()
->
publish
(
whom
,
{
port
,
addr
});
}
actor_ptr
remote_actor
(
const
char
*
host
,
std
::
uint16_t
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