[wpiutil] WebSocket: Make Shutdown() public (#3651)

This commit is contained in:
Peter Johnson
2021-10-20 08:45:58 -07:00
committed by GitHub
parent 2b3a9a52b3
commit 8cb294aa4a

View File

@@ -387,6 +387,11 @@ class WebSocket : public std::enable_shared_from_this<WebSocket> {
*/
void SetData(std::shared_ptr<void> 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<WebSocket> {
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<const uv::Buffer> data,
std::function<void(span<uv::Buffer>, uv::Error)> callback);