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
e47b5f40
Commit
e47b5f40
authored
Jan 22, 2020
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include review feedback
parent
0e815a1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
9 deletions
+6
-9
libcaf_net/caf/net/datagram_transport.hpp
libcaf_net/caf/net/datagram_transport.hpp
+3
-5
libcaf_net/caf/net/stream_transport.hpp
libcaf_net/caf/net/stream_transport.hpp
+3
-4
No files found.
libcaf_net/caf/net/datagram_transport.hpp
View file @
e47b5f40
...
...
@@ -79,14 +79,12 @@ public:
}
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
));
for
(
size_t
reads
=
0
;
reads
<
this
->
max_consecutive_reads_
;
++
reads
)
{
auto
ret
=
read
(
this
->
handle_
,
this
->
read_buf_
);
if
(
auto
res
=
get_if
<
std
::
pair
<
size_t
,
ip_endpoint
>>
(
&
ret
))
{
auto
num_bytes
=
res
->
first
;
auto
&
[
num_bytes
,
ep
]
=
*
res
;
CAF_LOG_DEBUG
(
"received "
<<
num_bytes
<<
" bytes"
);
auto
ep
=
res
->
second
;
this
->
read_buf_
.
resize
(
num_bytes
);
this
->
next_layer_
.
handle_data
(
*
this
,
this
->
read_buf_
,
std
::
move
(
ep
));
prepare_next_read
();
...
...
libcaf_net/caf/net/stream_transport.hpp
View file @
e47b5f40
...
...
@@ -73,12 +73,11 @@ public:
// -- member functions -------------------------------------------------------
bool
handle_read_event
(
endpoint_manager
&
)
override
{
size_t
reads
=
0
;
while
(
reads
++
<
this
->
max_consecutive_reads_
)
{
CAF_LOG_TRACE
(
CAF_ARG2
(
"handle"
,
this
->
handle
().
id
))
;
for
(
size_t
reads
=
0
;
reads
<
this
->
max_consecutive_reads_
;
++
reads
)
{
auto
buf
=
this
->
read_buf_
.
data
()
+
this
->
collected_
;
size_t
len
=
this
->
read_threshold_
-
this
->
collected_
;
CAF_LOG_TRACE
(
CAF_ARG2
(
"handle"
,
this
->
handle
().
id
)
<<
CAF_ARG2
(
"missing"
,
len
));
CAF_LOG_DEBUG
(
CAF_ARG2
(
"missing"
,
len
));
auto
ret
=
read
(
this
->
handle_
,
make_span
(
buf
,
len
));
// Update state.
if
(
auto
num_bytes
=
get_if
<
size_t
>
(
&
ret
))
{
...
...
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