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
f394cc01
Commit
f394cc01
authored
Apr 23, 2023
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flow setup for WebSocket servers
parent
73c3ad38
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
1 deletion
+16
-1
CHANGELOG.md
CHANGELOG.md
+7
-0
examples/web_socket/echo.cpp
examples/web_socket/echo.cpp
+8
-1
libcaf_net/caf/net/web_socket/server_factory.hpp
libcaf_net/caf/net/web_socket/server_factory.hpp
+1
-0
No files found.
CHANGELOG.md
View file @
f394cc01
...
...
@@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file. The format
is based on
[
Keep a Changelog
](
https://keepachangelog.com
)
.
## [Unreleased]
### Fixed
-
Fix flow setup for servers that use
`web_socket::with`
. This bug caused
servers to immediately abort incoming connection (#1402).
## [0.19.0] - 2023-04-17
### Added
...
...
examples/web_socket/echo.cpp
View file @
f394cc01
...
...
@@ -93,6 +93,13 @@ int caf_main(caf::actor_system& sys, const config& cfg) {
// ... that simply pushes data back to the sender.
auto
[
pull
,
push
]
=
ev
.
data
();
pull
.
observe_on
(
self
)
.
do_on_error
([](
const
caf
::
error
&
what
)
{
//
std
::
cout
<<
"*** connection closed: "
<<
to_string
(
what
)
<<
"
\n
"
;
})
.
do_on_complete
([]
{
//
std
::
cout
<<
"*** connection closed
\n
"
;
})
.
do_on_next
([](
const
ws
::
frame
&
x
)
{
if
(
x
.
is_binary
())
{
std
::
cout
...
...
@@ -115,7 +122,7 @@ int caf_main(caf::actor_system& sys, const config& cfg) {
return
EXIT_FAILURE
;
}
// Note: the actor system will keep the application running for as long as the
// worker
s are
still alive.
// worker
from .start() is
still alive.
return
EXIT_SUCCESS
;
}
// --(rst-main-end)--
...
...
libcaf_net/caf/net/web_socket/server_factory.hpp
View file @
f394cc01
...
...
@@ -78,6 +78,7 @@ public:
(
*
on_request_
)(
acc
);
if
(
acc
.
accepted
())
{
app_event
=
std
::
move
(
acc
.
app_event
);
ws_resources
=
std
::
move
(
acc
.
ws_resources
);
return
{};
}
return
std
::
move
(
acc
)
//
...
...
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