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
20ca5b50
Commit
20ca5b50
authored
Sep 11, 2020
by
Jakob Otto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix formatting
parent
d09a20c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
libcaf_net/src/udp_datagram_socket.cpp
libcaf_net/src/udp_datagram_socket.cpp
+2
-3
libcaf_net/test/net/length_prefix_framing.cpp
libcaf_net/test/net/length_prefix_framing.cpp
+3
-5
No files found.
libcaf_net/src/udp_datagram_socket.cpp
View file @
20ca5b50
...
@@ -114,9 +114,8 @@ variant<size_t, sec> write(udp_datagram_socket x, span<const byte> buf,
...
@@ -114,9 +114,8 @@ variant<size_t, sec> write(udp_datagram_socket x, span<const byte> buf,
ip_endpoint
ep
)
{
ip_endpoint
ep
)
{
sockaddr_storage
addr
=
{};
sockaddr_storage
addr
=
{};
detail
::
convert
(
ep
,
addr
);
detail
::
convert
(
ep
,
addr
);
auto
len
=
static_cast
<
socklen_t
>
(
ep
.
address
().
embeds_v4
()
auto
len
=
static_cast
<
socklen_t
>
(
?
sizeof
(
sockaddr_in
)
ep
.
address
().
embeds_v4
()
?
sizeof
(
sockaddr_in
)
:
sizeof
(
sockaddr_in6
));
:
sizeof
(
sockaddr_in6
));
auto
res
=
::
sendto
(
x
.
id
,
reinterpret_cast
<
socket_send_ptr
>
(
buf
.
data
()),
auto
res
=
::
sendto
(
x
.
id
,
reinterpret_cast
<
socket_send_ptr
>
(
buf
.
data
()),
buf
.
size
(),
0
,
reinterpret_cast
<
sockaddr
*>
(
&
addr
),
len
);
buf
.
size
(),
0
,
reinterpret_cast
<
sockaddr
*>
(
&
addr
),
len
);
auto
ret
=
check_udp_datagram_socket_io_res
(
res
);
auto
ret
=
check_udp_datagram_socket_io_res
(
res
);
...
...
libcaf_net/test/net/length_prefix_framing.cpp
View file @
20ca5b50
...
@@ -23,12 +23,12 @@
...
@@ -23,12 +23,12 @@
#include "caf/test/dsl.hpp"
#include "caf/test/dsl.hpp"
#include <deque>
#include <deque>
#include <vector>
#include <numeric>
#include <numeric>
#include <vector>
#include "caf/binary_serializer.hpp"
#include "caf/byte.hpp"
#include "caf/byte.hpp"
#include "caf/byte_buffer.hpp"
#include "caf/byte_buffer.hpp"
#include "caf/binary_serializer.hpp"
#include "caf/detail/network_order.hpp"
#include "caf/detail/network_order.hpp"
#include "caf/span.hpp"
#include "caf/span.hpp"
#include "caf/tag/message_oriented.hpp"
#include "caf/tag/message_oriented.hpp"
...
@@ -71,7 +71,6 @@ struct ul_expect_messages {
...
@@ -71,7 +71,6 @@ struct ul_expect_messages {
/// lower layer: offer stream for message parsing
/// lower layer: offer stream for message parsing
template
<
class
UpperLayer
>
template
<
class
UpperLayer
>
struct
ll_provide_stream_for_messages
{
struct
ll_provide_stream_for_messages
{
using
output_tag
=
tag
::
stream_oriented
;
using
output_tag
=
tag
::
stream_oriented
;
void
set_expectations
(
std
::
vector
<
byte
>
data
,
void
set_expectations
(
std
::
vector
<
byte
>
data
,
...
@@ -141,8 +140,7 @@ void encode_message(std::vector<byte>& data, const byte_buffer& message) {
...
@@ -141,8 +140,7 @@ void encode_message(std::vector<byte>& data, const byte_buffer& message) {
struct
fixture
{
struct
fixture
{
using
test_layers
=
ll_provide_stream_for_messages
<
using
test_layers
=
ll_provide_stream_for_messages
<
net
::
length_prefix_framing
<
net
::
length_prefix_framing
<
ul_expect_messages
>>
;
ul_expect_messages
>>
;
void
generate_messages
(
size_t
num
,
size_t
factor
=
10
)
{
void
generate_messages
(
size_t
num
,
size_t
factor
=
10
)
{
for
(
size_t
n
=
1
;
n
<=
num
;
n
+=
1
)
{
for
(
size_t
n
=
1
;
n
<=
num
;
n
+=
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