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
81b8f743
Commit
81b8f743
authored
Oct 01, 2020
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Integrate review feedback
parent
1a359629
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
18 additions
and
32 deletions
+18
-32
examples/net/web-socket-calculator.cpp
examples/net/web-socket-calculator.cpp
+2
-4
libcaf_net/caf/net/basp/application.hpp
libcaf_net/caf/net/basp/application.hpp
+1
-2
libcaf_net/caf/net/basp/remote_message_handler.hpp
libcaf_net/caf/net/basp/remote_message_handler.hpp
+3
-3
libcaf_net/caf/net/connection_acceptor.hpp
libcaf_net/caf/net/connection_acceptor.hpp
+1
-0
libcaf_net/caf/net/length_prefix_framing.hpp
libcaf_net/caf/net/length_prefix_framing.hpp
+1
-2
libcaf_net/caf/net/mixed_message_oriented_layer_ptr.hpp
libcaf_net/caf/net/mixed_message_oriented_layer_ptr.hpp
+3
-3
libcaf_net/caf/net/web_socket_framing.hpp
libcaf_net/caf/net/web_socket_framing.hpp
+1
-2
libcaf_net/caf/net/web_socket_server.hpp
libcaf_net/caf/net/web_socket_server.hpp
+1
-2
libcaf_net/caf/tag/mixed_message_oriented.hpp
libcaf_net/caf/tag/mixed_message_oriented.hpp
+1
-5
libcaf_net/src/tcp_accept_socket.cpp
libcaf_net/src/tcp_accept_socket.cpp
+0
-3
libcaf_net/test/net/actor_shell.cpp
libcaf_net/test/net/actor_shell.cpp
+2
-2
libcaf_net/test/net/length_prefix_framing.cpp
libcaf_net/test/net/length_prefix_framing.cpp
+1
-2
libcaf_net/test/net/web_socket_server.cpp
libcaf_net/test/net/web_socket_server.cpp
+1
-2
No files found.
examples/net/web-socket-calculator.cpp
View file @
81b8f743
...
...
@@ -38,6 +38,7 @@
#include "caf/actor_system.hpp"
#include "caf/actor_system_config.hpp"
#include "caf/byte_span.hpp"
#include "caf/event_based_actor.hpp"
#include "caf/exec_main.hpp"
#include "caf/ip_endpoint.hpp"
...
...
@@ -105,9 +106,6 @@ public:
// We expect a stream-oriented interface to the lower communication layers.
using
input_tag
=
caf
::
tag
::
mixed_message_oriented
;
// Convenience alias.
using
byte_span
=
caf
::
span
<
caf
::
byte
>
;
// -- constants --------------------------------------------------------------
// Restricts our buffer to a maximum of 1MB.
...
...
@@ -223,7 +221,7 @@ public:
}
template
<
class
LowerLayerPtr
>
ptrdiff_t
consume_binary
(
LowerLayerPtr
down
,
byte_span
)
{
ptrdiff_t
consume_binary
(
LowerLayerPtr
down
,
caf
::
byte_span
)
{
// Reject binary input.
auto
err
=
caf
::
make_error
(
caf
::
sec
::
runtime_error
,
"received binary WebSocket frame (unsupported)"
);
...
...
libcaf_net/caf/net/basp/application.hpp
View file @
81b8f743
...
...
@@ -29,6 +29,7 @@
#include "caf/actor_system.hpp"
#include "caf/actor_system_config.hpp"
#include "caf/byte.hpp"
#include "caf/byte_span.hpp"
#include "caf/callback.hpp"
#include "caf/defaults.hpp"
#include "caf/detail/net_export.hpp"
...
...
@@ -57,8 +58,6 @@ class CAF_NET_EXPORT application {
public:
// -- member types -----------------------------------------------------------
using
byte_span
=
span
<
byte
>
;
using
hub_type
=
detail
::
worker_hub
<
worker
>
;
struct
test_tag
{};
...
...
libcaf_net/caf/net/basp/remote_message_handler.hpp
View file @
81b8f743
...
...
@@ -53,9 +53,9 @@ public:
std
::
vector
<
strong_actor_ptr
>
fwd_stack
;
message
content
;
binary_deserializer
source
{
ctx
,
payload
};
if
(
auto
err
=
source
.
apply_objects
(
src_node
,
src_id
,
dst_id
,
fwd_stack
,
content
))
{
CAF_LOG_ERROR
(
"could not deserialize payload: "
<<
CAF_ARG
(
err
));
if
(
!
source
.
apply_objects
(
src_node
,
src_id
,
dst_id
,
fwd_stack
,
content
))
{
CAF_LOG_ERROR
(
"failed to deserialize payload:"
<<
CAF_ARG
(
source
.
get_error
()
));
return
;
}
// Sanity checks.
...
...
libcaf_net/caf/net/connection_acceptor.hpp
View file @
81b8f743
...
...
@@ -55,6 +55,7 @@ public:
error
init
(
socket_manager
*
owner
,
ParentPtr
parent
,
const
settings
&
config
)
{
CAF_LOG_TRACE
(
""
);
owner_
=
owner
;
cfg_
=
config
;
if
(
auto
err
=
factory_
.
init
(
owner
,
config
))
return
err
;
parent
->
register_reading
();
...
...
libcaf_net/caf/net/length_prefix_framing.hpp
View file @
81b8f743
...
...
@@ -23,6 +23,7 @@
#include <memory>
#include "caf/byte.hpp"
#include "caf/byte_span.hpp"
#include "caf/detail/network_order.hpp"
#include "caf/error.hpp"
#include "caf/net/receive_policy.hpp"
...
...
@@ -41,8 +42,6 @@ namespace caf::net {
template
<
class
UpperLayer
>
class
length_prefix_framing
{
public:
using
byte_span
=
span
<
byte
>
;
using
input_tag
=
tag
::
stream_oriented
;
using
output_tag
=
tag
::
message_oriented
;
...
...
libcaf_net/caf/net/mixed_message_oriented_layer_ptr.hpp
View file @
81b8f743
...
...
@@ -25,9 +25,9 @@
namespace
caf
::
net
{
/// Wraps a pointer to a
stream-oriented layer with a pointer to its lower
/// l
ayer. Both pointers are then used to implement the interface required for a
/// mixed-message-oriented layer when calling into its upper layer.
/// Wraps a pointer to a
mixed-message-oriented layer with a pointer to its
/// l
ower layer. Both pointers are then used to implement the interface required
///
for a
mixed-message-oriented layer when calling into its upper layer.
template
<
class
Layer
,
class
LowerLayerPtr
>
class
mixed_message_oriented_layer_ptr
{
public:
...
...
libcaf_net/caf/net/web_socket_framing.hpp
View file @
81b8f743
...
...
@@ -19,6 +19,7 @@
#pragma once
#include "caf/byte.hpp"
#include "caf/byte_span.hpp"
#include "caf/detail/rfc6455.hpp"
#include "caf/net/mixed_message_oriented_layer_ptr.hpp"
#include "caf/sec.hpp"
...
...
@@ -39,8 +40,6 @@ class web_socket_framing {
public:
// -- member types -----------------------------------------------------------
using
byte_span
=
span
<
byte
>
;
using
binary_buffer
=
std
::
vector
<
byte
>
;
using
text_buffer
=
std
::
vector
<
char
>
;
...
...
libcaf_net/caf/net/web_socket_server.hpp
View file @
81b8f743
...
...
@@ -20,6 +20,7 @@
#include <algorithm>
#include "caf/byte_span.hpp"
#include "caf/detail/encode_base64.hpp"
#include "caf/error.hpp"
#include "caf/hash/sha1.hpp"
...
...
@@ -42,8 +43,6 @@ class web_socket_server {
public:
// -- member types -----------------------------------------------------------
using
byte_span
=
span
<
byte
>
;
using
input_tag
=
tag
::
stream_oriented
;
using
output_tag
=
tag
::
mixed_message_oriented
;
...
...
libcaf_net/caf/tag/mixed_message_oriented.hpp
View file @
81b8f743
...
...
@@ -20,10 +20,6 @@
namespace
caf
::
tag
{
class
mixed_message_oriented
{
public:
mixed_message_oriented
();
~
mixed_message_oriented
();
};
struct
mixed_message_oriented
{};
}
// namespace caf::tag
libcaf_net/src/tcp_accept_socket.cpp
View file @
81b8f743
...
...
@@ -55,9 +55,6 @@ template <int Family>
expected
<
tcp_accept_socket
>
new_tcp_acceptor_impl
(
uint16_t
port
,
const
char
*
addr
,
bool
reuse_addr
,
bool
any
)
{
auto
bts
=
[](
bool
x
)
{
return
x
?
"true"
:
"false"
;
};
printf
(
"%s(%d, %s, %s, %s)
\n
"
,
__func__
,
(
int
)
port
,
addr
,
bts
(
reuse_addr
),
bts
(
any
));
static_assert
(
Family
==
AF_INET
||
Family
==
AF_INET6
,
"invalid family"
);
CAF_LOG_TRACE
(
CAF_ARG
(
port
)
<<
", addr = "
<<
(
addr
?
addr
:
"nullptr"
));
int
socktype
=
SOCK_STREAM
;
...
...
libcaf_net/test/net/actor_shell.cpp
View file @
81b8f743
...
...
@@ -22,6 +22,8 @@
#include "net-test.hpp"
#include "caf/byte.hpp"
#include "caf/byte_span.hpp"
#include "caf/callback.hpp"
#include "caf/net/middleman.hpp"
#include "caf/net/socket_guard.hpp"
...
...
@@ -34,8 +36,6 @@ using namespace std::string_literals;
namespace
{
using
byte_span
=
span
<
byte
>
;
using
svec
=
std
::
vector
<
std
::
string
>
;
struct
app_t
{
...
...
libcaf_net/test/net/length_prefix_framing.cpp
View file @
81b8f743
...
...
@@ -29,6 +29,7 @@
#include "caf/binary_serializer.hpp"
#include "caf/byte.hpp"
#include "caf/byte_buffer.hpp"
#include "caf/byte_span.hpp"
#include "caf/detail/network_order.hpp"
#include "caf/span.hpp"
#include "caf/tag/message_oriented.hpp"
...
...
@@ -40,8 +41,6 @@ namespace {
/// upper layer: expect messages
/// Needs to be initilized by the layer two steps down.
struct
ul_expect_messages
{
using
byte_span
=
span
<
byte
>
;
using
input_tag
=
tag
::
message_oriented
;
void
set_expected_messages
(
std
::
vector
<
byte_buffer
>
messages
)
{
...
...
libcaf_net/test/net/web_socket_server.cpp
View file @
81b8f743
...
...
@@ -22,6 +22,7 @@
#include "net-test.hpp"
#include "caf/byte_span.hpp"
#include "caf/net/multiplexer.hpp"
#include "caf/net/socket_manager.hpp"
#include "caf/net/stream_socket.hpp"
...
...
@@ -33,8 +34,6 @@ using namespace std::literals::string_literals;
namespace
{
using
byte_span
=
span
<
byte
>
;
using
svec
=
std
::
vector
<
std
::
string
>
;
struct
app_t
{
...
...
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