Commit 516659f9 authored by Jakob Otto's avatar Jakob Otto

Implement read retries for udp

parent b5c3fb8a
...@@ -79,6 +79,8 @@ public: ...@@ -79,6 +79,8 @@ public:
} }
bool handle_read_event(endpoint_manager&) override { bool handle_read_event(endpoint_manager&) override {
size_t reads = 0;
while (reads++ < this->max_consecutive_reads_) {
CAF_LOG_TRACE(CAF_ARG(this->handle_.id)); CAF_LOG_TRACE(CAF_ARG(this->handle_.id));
auto ret = read(this->handle_, this->read_buf_); auto ret = read(this->handle_, this->read_buf_);
if (auto res = get_if<std::pair<size_t, ip_endpoint>>(&ret)) { if (auto res = get_if<std::pair<size_t, ip_endpoint>>(&ret)) {
...@@ -94,6 +96,7 @@ public: ...@@ -94,6 +96,7 @@ public:
this->next_layer_.handle_error(err); this->next_layer_.handle_error(err);
return false; return false;
} }
}
return true; return 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