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
a9d02b21
Commit
a9d02b21
authored
Jan 13, 2015
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow brokers to add native sockets directly
parent
514f681e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
libcaf_io/caf/io/broker.hpp
libcaf_io/caf/io/broker.hpp
+5
-0
libcaf_io/src/broker.cpp
libcaf_io/src/broker.cpp
+7
-0
No files found.
libcaf_io/caf/io/broker.hpp
View file @
a9d02b21
...
...
@@ -38,6 +38,7 @@
#include "caf/io/receive_policy.hpp"
#include "caf/io/system_messages.hpp"
#include "caf/io/connection_handle.hpp"
#include "caf/io/network/native_socket.hpp"
#include "caf/io/network/stream_manager.hpp"
#include "caf/io/network/acceptor_manager.hpp"
...
...
@@ -254,6 +255,8 @@ class broker : public extend<local_actor>::
connection_handle
add_tcp_scribe
(
const
std
::
string
&
host
,
uint16_t
port
);
connection_handle
add_tcp_scribe
(
network
::
native_socket
fd
);
inline
void
add_doorman
(
const
doorman_pointer
&
ptr
)
{
m_doormen
.
insert
(
std
::
make_pair
(
ptr
->
hdl
(),
ptr
));
if
(
is_initialized
())
{
...
...
@@ -265,6 +268,8 @@ class broker : public extend<local_actor>::
const
char
*
in
=
nullptr
,
bool
reuse_addr
=
false
);
accept_handle
add_tcp_doorman
(
network
::
native_socket
fd
);
void
invoke_message
(
const
actor_addr
&
sender
,
message_id
mid
,
message
&
msg
);
void
enqueue
(
const
actor_addr
&
,
message_id
,
message
,
...
...
libcaf_io/src/broker.cpp
View file @
a9d02b21
...
...
@@ -361,11 +361,18 @@ connection_handle broker::add_tcp_scribe(const std::string& hst, uint16_t prt) {
return
backend
().
add_tcp_scribe
(
this
,
hst
,
prt
);
}
connection_handle
broker
::
add_tcp_scribe
(
network
::
native_socket
fd
)
{
return
backend
().
add_tcp_scribe
(
this
,
fd
);
}
std
::
pair
<
accept_handle
,
uint16_t
>
broker
::
add_tcp_doorman
(
uint16_t
port
,
const
char
*
in
,
bool
reuse_addr
)
{
return
backend
().
add_tcp_doorman
(
this
,
port
,
in
,
reuse_addr
);
}
accept_handle
broker
::
add_tcp_doorman
(
network
::
native_socket
fd
)
{
return
backend
().
add_tcp_doorman
(
this
,
fd
);
}
}
// namespace io
}
// namespace caf
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