[COMMIT seastar master] websocket: implement closing websocket connection

0 views
Skip to first unread message

Commit Bot

<bot@cloudius-systems.com>
unread,
Jun 23, 2022, 8:25:50 AM6/23/22
to seastar-dev@googlegroups.com, kozakusek
From: kozakusek <bk41...@students.mimuw.edu.pl>
Committer: Piotr Sarna <sa...@scylladb.com>
Branch: master

websocket: implement closing websocket connection

---
diff --git a/include/seastar/websocket/server.hh b/include/seastar/websocket/server.hh
--- a/include/seastar/websocket/server.hh
+++ b/include/seastar/websocket/server.hh
@@ -284,6 +284,8 @@ public:
* \brief close the socket
*/
void shutdown();
+
+ future<> close();

protected:
future<> read_loop();
diff --git a/src/websocket/server.cc b/src/websocket/server.cc
--- a/src/websocket/server.cc
+++ b/src/websocket/server.cc
@@ -410,6 +410,10 @@ void connection::shutdown() {
_fd.shutdown_output();
}

+future<> connection::close() {
+ return this->close(true);
+}
+
bool server::is_handler_registered(std::string const& name) {
return _handlers.find(name) != _handlers.end();
}
Reply all
Reply to author
Forward
0 new messages