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
886f5e78
Commit
886f5e78
authored
Dec 28, 2021
by
chenhuaqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement shutdown
parent
ebebef9f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
3 deletions
+17
-3
examples/net/web-socket-feed.cpp
examples/net/web-socket-feed.cpp
+1
-1
libcaf_net/caf/net/mixed_message_oriented_layer_ptr.hpp
libcaf_net/caf/net/mixed_message_oriented_layer_ptr.hpp
+1
-1
libcaf_net/caf/net/socket_manager.hpp
libcaf_net/caf/net/socket_manager.hpp
+4
-0
libcaf_net/caf/net/stream_oriented_layer_ptr.hpp
libcaf_net/caf/net/stream_oriented_layer_ptr.hpp
+4
-0
libcaf_net/caf/net/stream_transport.hpp
libcaf_net/caf/net/stream_transport.hpp
+5
-0
libcaf_net/caf/net/web_socket/framing.hpp
libcaf_net/caf/net/web_socket/framing.hpp
+1
-0
libcaf_net/src/multiplexer.cpp
libcaf_net/src/multiplexer.cpp
+1
-1
No files found.
examples/net/web-socket-feed.cpp
View file @
886f5e78
...
...
@@ -246,7 +246,7 @@ public:
std
::
cout
<<
down
->
handle
().
id
<<
" receive text: "
<<
text
<<
"
\n
"
;
if
(
"close"
==
text
)
{
down
->
close
(
100
0
,
"Bye"
);
down
->
close
(
100
1
,
"Bye"
);
}
return
static_cast
<
ptrdiff_t
>
(
text
.
size
());
}
...
...
libcaf_net/caf/net/mixed_message_oriented_layer_ptr.hpp
View file @
886f5e78
...
...
@@ -7,6 +7,7 @@
#include "caf/error.hpp"
#include "caf/fwd.hpp"
#include "caf/net/fwd.hpp"
#include <caf/sec.hpp>
namespace
caf
::
net
{
...
...
@@ -56,7 +57,6 @@ public:
void
close
(
uint16_t
code
,
string_view
reason
)
{
lptr_
->
close
(
llptr_
,
code
,
reason
);
abort_reason
();
}
void
abort_reason
(
error
reason
)
{
...
...
libcaf_net/caf/net/socket_manager.hpp
View file @
886f5e78
...
...
@@ -101,6 +101,10 @@ public:
return
abort_reason_
;
}
void
shutdown
()
{
mask_
=
operation
::
shutdown
;
}
// -- factories --------------------------------------------------------------
template
<
class
Handle
=
actor
,
class
LowerLayerPtr
,
class
FallbackHandler
>
...
...
libcaf_net/caf/net/stream_oriented_layer_ptr.hpp
View file @
886f5e78
...
...
@@ -51,6 +51,10 @@ public:
return
lptr_
->
abort_reason
(
llptr_
);
}
void
shutdown
()
{
lptr_
->
shutdown
(
llptr_
);
}
void
configure_read
(
receive_policy
policy
)
{
lptr_
->
configure_read
(
llptr_
,
policy
);
}
...
...
libcaf_net/caf/net/stream_transport.hpp
View file @
886f5e78
...
...
@@ -84,6 +84,11 @@ public:
return
parent
->
abort_reason
();
}
template
<
class
ParentPtr
>
static
void
shutdown
(
ParentPtr
parent
)
{
parent
->
shutdown
();
}
template
<
class
ParentPtr
>
void
configure_read
(
ParentPtr
parent
,
receive_policy
policy
)
{
if
(
policy
.
max_size
>
0
&&
max_read_size_
==
0
)
...
...
libcaf_net/caf/net/web_socket/framing.hpp
View file @
886f5e78
...
...
@@ -120,6 +120,7 @@ public:
template
<
class
LowerLayerPtr
>
void
close
(
LowerLayerPtr
down
,
int
code
,
string_view
reason
)
{
ship_close
(
down
,
code
,
reason
);
down
->
shutdown
();
}
template
<
class
LowerLayerPtr
>
...
...
libcaf_net/src/multiplexer.cpp
View file @
886f5e78
...
...
@@ -278,7 +278,7 @@ void multiplexer::shutdown() {
close_pipe
();
}
else
{
CAF_LOG_DEBUG
(
"push shutdown event to pipe"
);
write_to_pipe
(
4
,
nullptr
);
write_to_pipe
(
pollset_updater
::
shutdown_code
,
nullptr
);
}
}
...
...
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