Skip to content

Commit

Permalink
websocket::stream: add is_open()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tectu committed Jul 21, 2022
1 parent d659a69 commit 90156ab
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/malloy/core/websocket/stream.hpp
Expand Up @@ -187,6 +187,18 @@ namespace malloy::websocket
return std::visit([](auto& s) { return s.get_executor(); }, m_underlying_conn);
}

/**
* @brief Returns `true` if the stream is open.
* @details The stream is open after a successful handshake, and when no error has occurred.
*
* @return Whether the stream is open.
*/
bool
is_open() const
{
return std::visit([](auto& s){ return s.is_open(); }, m_underlying_conn);
}

/**
* @brief Whether the underlying stream is TLS or not
* @note Always false if MALLOY_FEATURE_TLS == 0
Expand Down

0 comments on commit 90156ab

Please sign in to comment.