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
85ef2191
Commit
85ef2191
authored
Aug 03, 2018
by
Joseph Noir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix UDP newb client creation and accepting
parent
ea6ab1f4
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
108 additions
and
155 deletions
+108
-155
examples/remoting/tcp_newb.cpp
examples/remoting/tcp_newb.cpp
+5
-4
examples/remoting/udp_newb.cpp
examples/remoting/udp_newb.cpp
+100
-147
libcaf_io/caf/io/network/newb.hpp
libcaf_io/caf/io/network/newb.hpp
+2
-3
libcaf_io/test/protocol_policy.cpp
libcaf_io/test/protocol_policy.cpp
+1
-1
No files found.
examples/remoting/tcp_newb.cpp
View file @
85ef2191
...
...
@@ -149,8 +149,9 @@ struct basp {
}
void
prepare_for_sending
(
io
::
network
::
byte_buffer
&
buf
,
size_t
hstart
,
size_t
plen
)
{
stream_serializer
<
charbuf
>
out
{
&
parent
->
backend
(),
buf
.
data
()
+
hstart
,
size_t
hstart
,
size_t
offset
,
size_t
plen
)
{
stream_serializer
<
charbuf
>
out
{
&
parent
->
backend
(),
buf
.
data
()
+
hstart
+
offset
,
sizeof
(
uint32_t
)};
auto
len
=
static_cast
<
uint32_t
>
(
plen
);
out
(
len
);
...
...
@@ -310,8 +311,8 @@ struct tcp_protocol
}
void
prepare_for_sending
(
io
::
network
::
byte_buffer
&
buf
,
size_t
hstart
,
size_t
plen
)
override
{
impl
.
prepare_for_sending
(
buf
,
hstart
,
plen
);
size_t
offset
,
size_t
plen
)
override
{
impl
.
prepare_for_sending
(
buf
,
hstart
,
offset
,
plen
);
}
};
...
...
examples/remoting/udp_newb.cpp
View file @
85ef2191
This diff is collapsed.
Click to expand it.
libcaf_io/caf/io/network/newb.hpp
View file @
85ef2191
...
...
@@ -182,7 +182,7 @@ struct protocol_policy_base {
virtual
void
write_header
(
byte_buffer
&
,
header_writer
*
)
=
0
;
virtual
void
prepare_for_sending
(
byte_buffer
&
,
size_t
,
size_t
)
=
0
;
virtual
void
prepare_for_sending
(
byte_buffer
&
,
size_t
,
size_t
,
size_t
)
=
0
;
};
template
<
class
T
>
...
...
@@ -211,7 +211,7 @@ struct write_handle {
~
write_handle
()
{
// Can we calculate added bytes for datagram things?
auto
payload_size
=
buf
->
size
()
-
(
header_start
+
header_len
);
protocol
->
prepare_for_sending
(
*
buf
,
header_start
,
payload_size
);
protocol
->
prepare_for_sending
(
*
buf
,
header_start
,
0
,
payload_size
);
parent
->
flush
();
}
};
...
...
@@ -308,7 +308,6 @@ struct newb : public extend<scheduled_actor, newb<Message>>::template
// -- overridden modifiers of event handler ----------------------------------
void
handle_event
(
network
::
operation
op
)
override
{
//std::cerr << "got event: " << to_string(op) << std::endl;
CAF_PUSH_AID_FROM_PTR
(
this
);
CAF_LOG_TRACE
(
""
);
switch
(
op
)
{
...
...
libcaf_io/test/protocol_policy.cpp
View file @
85ef2191
...
...
@@ -111,7 +111,7 @@ struct protocol_policy_impl
return
impl
.
write_header
(
buf
,
hw
);
}
void
prepare_for_sending
(
byte_buffer
&
,
size_t
,
size_t
)
override
{
void
prepare_for_sending
(
byte_buffer
&
,
size_t
,
size_t
,
size_t
)
override
{
return
;
}
};
...
...
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