Commit 564489f8 authored by Jakob Otto's avatar Jakob Otto

Fix build errors after merge

parent e9541de1
......@@ -48,6 +48,8 @@ public:
using factory_type = Factory;
using transport_type = datagram_transport;
using application_type = typename Factory::application_type;
using dispatcher_type = transport_worker_dispatcher<factory_type,
......@@ -104,8 +106,7 @@ public:
// Get new data from parent.
for (auto msg = parent.next_message(); msg != nullptr;
msg = parent.next_message()) {
auto decorator = make_write_packet_decorator(*this, parent);
dispatcher_.write_message(decorator, std::move(msg));
dispatcher_.write_message(*this, std::move(msg));
}
// Write prepared data.
return write_some();
......@@ -169,14 +170,13 @@ public:
prepare_next_read();
}
template <class Parent>
void write_packet(Parent&, span<const byte> header, span<const byte> payload,
ip_endpoint ep) {
void write_packet(span<const byte> header, span<const byte> payload,
typename dispatcher_type::id_type id) {
std::vector<byte> buf;
buf.reserve(header.size() + payload.size());
buf.insert(buf.end(), header.begin(), header.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 {
......
......@@ -92,12 +92,6 @@ public:
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>
void resolve(Parent& parent, const std::string& path, actor listener) {
// TODO path should be uri to lookup the corresponding worker
......
......@@ -24,7 +24,6 @@
#include "host_fixture.hpp"
#include "caf/binary_deserializer.hpp"
#include "caf/byte.hpp"
#include "caf/make_actor.hpp"
#include "caf/net/actor_proxy_impl.hpp"
......@@ -84,15 +83,17 @@ public:
rec_buf_->insert(rec_buf_->begin(), data.begin(), data.end());
}
template <class Manager>
void resolve(Manager& manager, const std::string& path, actor listener) {
template <class Parent>
void resolve(Parent& parent, const std::string& path, actor listener) {
actor_id aid = 42;
auto hid = "0011223344556677889900112233445566778899";
auto nid = unbox(make_node_id(42, hid));
actor_config cfg;
endpoint_manager_ptr ptr{&parent.manager()};
auto p = make_actor<actor_proxy_impl, strong_actor_ptr>(aid, nid,
&manager.system(),
cfg, &manager);
&parent.system(),
cfg,
std::move(ptr));
anon_send(listener, resolve_atom::value, std::move(path), p);
}
......@@ -145,9 +146,11 @@ CAF_TEST(receive) {
ip_endpoint ep;
if (auto err = parse("127.0.0.1:0", ep))
CAF_FAIL("parse returned an error: " << err);
auto sender = unbox(make_udp_datagram_socket(ep));
ep.port(0);
auto receiver = unbox(make_udp_datagram_socket(ep));
auto send_pair = unbox(make_udp_datagram_socket(ep));
auto sender = send_pair.first;
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 receive_guard = make_socket_guard(receiver);
if (auto err = nonblocking(receiver, true))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment