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
79405550
Commit
79405550
authored
Oct 19, 2012
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maintenance
parent
94adf390
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
cppa/network/ipv4_acceptor.hpp
cppa/network/ipv4_acceptor.hpp
+1
-1
src/default_protocol.cpp
src/default_protocol.cpp
+4
-7
src/ipv4_acceptor.cpp
src/ipv4_acceptor.cpp
+1
-1
No files found.
cppa/network/ipv4_acceptor.hpp
View file @
79405550
...
...
@@ -44,7 +44,7 @@ class ipv4_acceptor : public acceptor {
public:
static
std
::
unique_ptr
<
acceptor
>
create
(
std
::
uint16_t
port
,
const
char
*
add
r
);
const
char
*
addr
=
nullpt
r
);
~
ipv4_acceptor
();
...
...
src/default_protocol.cpp
View file @
79405550
...
...
@@ -60,21 +60,19 @@ atom_value default_protocol::identifier() const {
}
void
default_protocol
::
publish
(
const
actor_ptr
&
whom
,
variant_args
args
)
{
CPPA_LOG_TRACE
(
"whom: "
<<
to_string
(
whom
)
CPPA_LOG_TRACE
(
CPPA_TARG
(
whom
,
to_string
)
<<
", args.size() = "
<<
args
.
size
());
if
(
!
whom
)
return
;
CPPA_REQUIRE
(
args
.
size
()
==
2
||
args
.
size
()
==
1
);
auto
i
=
args
.
begin
();
if
(
args
.
size
()
==
1
)
{
auto
port
=
get
<
uint16_t
>
(
*
i
++
);
publish
(
whom
,
unique_ptr
<
acceptor
>
(
ipv4_acceptor
::
create
(
port
,
nullptr
)),
{});
publish
(
whom
,
ipv4_acceptor
::
create
(
port
),
{});
}
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
()
)),
{});
publish
(
whom
,
ipv4_acceptor
::
create
(
port
,
addr
.
c_str
(
)),
{});
}
else
throw
logic_error
(
"wrong number of arguments, expected one or two"
);
}
...
...
@@ -82,8 +80,7 @@ void default_protocol::publish(const actor_ptr& whom, variant_args args) {
void
default_protocol
::
publish
(
const
actor_ptr
&
whom
,
std
::
unique_ptr
<
acceptor
>
ptr
,
variant_args
args
)
{
CPPA_LOG_TRACE
(
"whom: "
<<
to_string
(
whom
)
<<
", ptr = "
<<
ptr
.
get
()
CPPA_LOG_TRACE
(
CPPA_TARG
(
whom
,
to_string
)
<<
", "
<<
CPPA_MARG
(
ptr
,
get
)
<<
", args.size() = "
<<
args
.
size
());
if
(
!
whom
)
return
;
CPPA_REQUIRE
(
args
.
size
()
==
0
);
...
...
src/ipv4_acceptor.cpp
View file @
79405550
...
...
@@ -103,7 +103,7 @@ ipv4_acceptor::ipv4_acceptor(native_socket_type fd, bool nonblocking)
:
m_fd
(
fd
),
m_is_nonblocking
(
nonblocking
)
{
}
std
::
unique_ptr
<
acceptor
>
ipv4_acceptor
::
create
(
std
::
uint16_t
port
,
const
char
*
addr
)
{
const
char
*
addr
)
{
native_socket_type
sockfd
;
sockfd
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
);
if
(
sockfd
==
invalid_socket
)
{
...
...
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