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();
}