From 8cb294aa4a27b582c42c5e45191d4dadd7258648 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Wed, 20 Oct 2021 08:45:58 -0700 Subject: [PATCH] [wpiutil] WebSocket: Make Shutdown() public (#3651) --- wpiutil/src/main/native/include/wpi/WebSocket.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wpiutil/src/main/native/include/wpi/WebSocket.h b/wpiutil/src/main/native/include/wpi/WebSocket.h index 8b585347dc..6b50ea86df 100644 --- a/wpiutil/src/main/native/include/wpi/WebSocket.h +++ b/wpiutil/src/main/native/include/wpi/WebSocket.h @@ -387,6 +387,11 @@ class WebSocket : public std::enable_shared_from_this { */ void SetData(std::shared_ptr data) { m_data = std::move(data); } + /** + * Shuts down and closes the underlying stream. + */ + void Shutdown(); + /** * Open event. Emitted when the connection is open and ready to communicate. * The parameter is the selected subprotocol. @@ -462,7 +467,6 @@ class WebSocket : public std::enable_shared_from_this { std::string_view protocol); void SendClose(uint16_t code, std::string_view reason); void SetClosed(uint16_t code, std::string_view reason, bool failed = false); - void Shutdown(); void HandleIncoming(uv::Buffer& buf, size_t size); void Send(uint8_t opcode, span data, std::function, uv::Error)> callback);