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
e538599e
Commit
e538599e
authored
Sep 25, 2018
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove random drops
parent
96218a3b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
16 deletions
+0
-16
libcaf_io/caf/policy/newb_reliability.hpp
libcaf_io/caf/policy/newb_reliability.hpp
+0
-16
No files found.
libcaf_io/caf/policy/newb_reliability.hpp
View file @
e538599e
...
...
@@ -21,7 +21,6 @@
#include <cstdint>
#include <unordered_map>
#include <chrono>
#include <random>
#include "caf/binary_deserializer.hpp"
#include "caf/binary_serializer.hpp"
...
...
@@ -61,13 +60,6 @@ struct reliability {
io
::
newb
<
message_type
>*
parent
;
Next
next
;
std
::
unordered_map
<
id_type
,
io
::
byte_buffer
>
unacked
;
std
::
random_device
rd
;
std
::
mt19937
mt
;
std
::
uniform_int_distribution
<
int
>
dist
;
reliability
()
:
mt
(
rd
()),
dist
(
0
,
9
)
{
// nop
}
void
init
(
io
::
newb
<
message_type
>*
n
)
{
parent
=
n
;
...
...
@@ -80,17 +72,10 @@ struct reliability {
reliability_header
hdr
;
binary_deserializer
bd
(
&
parent
->
backend
(),
bytes
,
count
);
bd
(
hdr
);
auto
r
=
dist
(
mt
);
if
(
r
==
0
)
{
std
::
cerr
<<
"not this time: "
<<
hdr
.
id
<<
std
::
endl
;
return
none
;
}
if
(
hdr
.
is_ack
)
{
// TODO: Cancel timeout.
unacked
.
erase
(
hdr
.
id
);
std
::
cerr
<<
"got ack for "
<<
hdr
.
id
<<
std
::
endl
;
}
else
{
std
::
cerr
<<
"got header: "
<<
hdr
.
id
<<
std
::
endl
;
// Send ack.
auto
&
buf
=
parent
->
wr_buf
();
binary_serializer
bs
(
&
parent
->
backend
(),
buf
);
...
...
@@ -136,7 +121,6 @@ struct reliability {
// Add to unacked.
unacked
.
emplace
(
id_write
,
io
::
byte_buffer
(
buf
.
begin
()
+
hstart
,
buf
.
end
()));
std
::
cerr
<<
"awaiting ack for "
<<
id_write
<<
std
::
endl
;
id_write
+=
1
;
}
};
...
...
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