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
564489f8
Commit
564489f8
authored
Sep 22, 2019
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build errors after merge
parent
e9541de1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
20 deletions
+17
-20
libcaf_net/caf/net/datagram_transport.hpp
libcaf_net/caf/net/datagram_transport.hpp
+6
-6
libcaf_net/caf/net/transport_worker_dispatcher.hpp
libcaf_net/caf/net/transport_worker_dispatcher.hpp
+0
-6
libcaf_net/test/datagram_transport.cpp
libcaf_net/test/datagram_transport.cpp
+11
-8
No files found.
libcaf_net/caf/net/datagram_transport.hpp
View file @
564489f8
...
@@ -48,6 +48,8 @@ public:
...
@@ -48,6 +48,8 @@ public:
using
factory_type
=
Factory
;
using
factory_type
=
Factory
;
using
transport_type
=
datagram_transport
;
using
application_type
=
typename
Factory
::
application_type
;
using
application_type
=
typename
Factory
::
application_type
;
using
dispatcher_type
=
transport_worker_dispatcher
<
factory_type
,
using
dispatcher_type
=
transport_worker_dispatcher
<
factory_type
,
...
@@ -104,8 +106,7 @@ public:
...
@@ -104,8 +106,7 @@ public:
// Get new data from parent.
// Get new data from parent.
for
(
auto
msg
=
parent
.
next_message
();
msg
!=
nullptr
;
for
(
auto
msg
=
parent
.
next_message
();
msg
!=
nullptr
;
msg
=
parent
.
next_message
())
{
msg
=
parent
.
next_message
())
{
auto
decorator
=
make_write_packet_decorator
(
*
this
,
parent
);
dispatcher_
.
write_message
(
*
this
,
std
::
move
(
msg
));
dispatcher_
.
write_message
(
decorator
,
std
::
move
(
msg
));
}
}
// Write prepared data.
// Write prepared data.
return
write_some
();
return
write_some
();
...
@@ -169,14 +170,13 @@ public:
...
@@ -169,14 +170,13 @@ public:
prepare_next_read
();
prepare_next_read
();
}
}
template
<
class
Parent
>
void
write_packet
(
span
<
const
byte
>
header
,
span
<
const
byte
>
payload
,
void
write_packet
(
Parent
&
,
span
<
const
byte
>
header
,
span
<
const
byte
>
payload
,
typename
dispatcher_type
::
id_type
id
)
{
ip_endpoint
ep
)
{
std
::
vector
<
byte
>
buf
;
std
::
vector
<
byte
>
buf
;
buf
.
reserve
(
header
.
size
()
+
payload
.
size
());
buf
.
reserve
(
header
.
size
()
+
payload
.
size
());
buf
.
insert
(
buf
.
end
(),
header
.
begin
(),
header
.
end
());
buf
.
insert
(
buf
.
end
(),
header
.
begin
(),
header
.
end
());
buf
.
insert
(
buf
.
end
(),
payload
.
begin
(),
payload
.
end
());
buf
.
insert
(
buf
.
end
(),
payload
.
begin
(),
payload
.
end
());
packet_queue_
.
emplace_back
(
ep
,
std
::
move
(
buf
));
packet_queue_
.
emplace_back
(
id
,
std
::
move
(
buf
));
}
}
struct
packet
{
struct
packet
{
...
...
libcaf_net/caf/net/transport_worker_dispatcher.hpp
View file @
564489f8
...
@@ -92,12 +92,6 @@ public:
...
@@ -92,12 +92,6 @@ public:
worker
->
write_message
(
parent
,
std
::
move
(
msg
));
worker
->
write_message
(
parent
,
std
::
move
(
msg
));
}
}
template
<
class
Parent
>
void
write_packet
(
Parent
&
parent
,
span
<
const
byte
>
header
,
span
<
const
byte
>
payload
,
id_type
id
)
{
parent
.
write_packet
(
header
,
payload
,
id
);
}
template
<
class
Parent
>
template
<
class
Parent
>
void
resolve
(
Parent
&
parent
,
const
std
::
string
&
path
,
actor
listener
)
{
void
resolve
(
Parent
&
parent
,
const
std
::
string
&
path
,
actor
listener
)
{
// TODO path should be uri to lookup the corresponding worker
// TODO path should be uri to lookup the corresponding worker
...
...
libcaf_net/test/datagram_transport.cpp
View file @
564489f8
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
#include "host_fixture.hpp"
#include "host_fixture.hpp"
#include "caf/binary_deserializer.hpp"
#include "caf/byte.hpp"
#include "caf/byte.hpp"
#include "caf/make_actor.hpp"
#include "caf/make_actor.hpp"
#include "caf/net/actor_proxy_impl.hpp"
#include "caf/net/actor_proxy_impl.hpp"
...
@@ -84,15 +83,17 @@ public:
...
@@ -84,15 +83,17 @@ public:
rec_buf_
->
insert
(
rec_buf_
->
begin
(),
data
.
begin
(),
data
.
end
());
rec_buf_
->
insert
(
rec_buf_
->
begin
(),
data
.
begin
(),
data
.
end
());
}
}
template
<
class
Manager
>
template
<
class
Parent
>
void
resolve
(
Manager
&
manager
,
const
std
::
string
&
path
,
actor
listener
)
{
void
resolve
(
Parent
&
parent
,
const
std
::
string
&
path
,
actor
listener
)
{
actor_id
aid
=
42
;
actor_id
aid
=
42
;
auto
hid
=
"0011223344556677889900112233445566778899"
;
auto
hid
=
"0011223344556677889900112233445566778899"
;
auto
nid
=
unbox
(
make_node_id
(
42
,
hid
));
auto
nid
=
unbox
(
make_node_id
(
42
,
hid
));
actor_config
cfg
;
actor_config
cfg
;
endpoint_manager_ptr
ptr
{
&
parent
.
manager
()};
auto
p
=
make_actor
<
actor_proxy_impl
,
strong_actor_ptr
>
(
aid
,
nid
,
auto
p
=
make_actor
<
actor_proxy_impl
,
strong_actor_ptr
>
(
aid
,
nid
,
&
manager
.
system
(),
&
parent
.
system
(),
cfg
,
&
manager
);
cfg
,
std
::
move
(
ptr
));
anon_send
(
listener
,
resolve_atom
::
value
,
std
::
move
(
path
),
p
);
anon_send
(
listener
,
resolve_atom
::
value
,
std
::
move
(
path
),
p
);
}
}
...
@@ -145,9 +146,11 @@ CAF_TEST(receive) {
...
@@ -145,9 +146,11 @@ CAF_TEST(receive) {
ip_endpoint
ep
;
ip_endpoint
ep
;
if
(
auto
err
=
parse
(
"127.0.0.1:0"
,
ep
))
if
(
auto
err
=
parse
(
"127.0.0.1:0"
,
ep
))
CAF_FAIL
(
"parse returned an error: "
<<
err
);
CAF_FAIL
(
"parse returned an error: "
<<
err
);
auto
sender
=
unbox
(
make_udp_datagram_socket
(
ep
));
auto
send_pair
=
unbox
(
make_udp_datagram_socket
(
ep
));
ep
.
port
(
0
);
auto
sender
=
send_pair
.
first
;
auto
receiver
=
unbox
(
make_udp_datagram_socket
(
ep
));
auto
receive_pair
=
unbox
(
make_udp_datagram_socket
(
ep
));
auto
receiver
=
receive_pair
.
first
;
ep
.
port
(
htons
(
receive_pair
.
second
));
auto
send_guard
=
make_socket_guard
(
sender
);
auto
send_guard
=
make_socket_guard
(
sender
);
auto
receive_guard
=
make_socket_guard
(
receiver
);
auto
receive_guard
=
make_socket_guard
(
receiver
);
if
(
auto
err
=
nonblocking
(
receiver
,
true
))
if
(
auto
err
=
nonblocking
(
receiver
,
true
))
...
...
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