3#ifndef SYMBIAN_WEBSOCKET_WEBSOCKET_H_
4#define SYMBIAN_WEBSOCKET_WEBSOCKET_H_
15#include "absl/status/status.h"
16#include "absl/status/statusor.h"
24 std::function<absl::StatusOr<std::array<std::uint8_t, 4>>()>
mask_provider;
25 std::string
path =
"/symbian-agent";
47 static absl::StatusOr<std::unique_ptr<WebSocket>>
CreateUnique(
55 absl::Status
Feed(std::string_view
bytes);
57 absl::Status
Send(std::string_view message);
58 absl::StatusOr<std::optional<std::string>>
Receive();
67 explicit WebSocket(std::unique_ptr<State> state);
68 std::unique_ptr<State> state_;
Single-owner RFC 8441 WebSocket endpoint over nghttp2.
Definition websocket.h:44
bool closed() const
Definition websocket.cc:287
static absl::StatusOr< std::unique_ptr< WebSocket > > CreateUnique(Role role, Options options={})
Definition websocket.cc:195
absl::StatusOr< std::string > TakeOutput()
Definition websocket.cc:218
std::size_t buffered_amount() const
Definition websocket.cc:291
WebSocket & operator=(const WebSocket &)=delete
void Abort()
Definition websocket.cc:276
absl::StatusOr< std::optional< std::string > > Receive()
Definition websocket.cc:241
WebSocket & operator=(WebSocket &&other) noexcept
absl::Status Close()
Definition websocket.cc:256
WebSocket(const WebSocket &)=delete
absl::Status Feed(std::string_view bytes)
Definition websocket.cc:206
WebSocket(WebSocket &&other) noexcept
bool open() const
Definition websocket.cc:282
static absl::StatusOr< WebSocket > Create(Role role, Options options={})
Definition websocket.cc:172
absl::Status Send(std::string_view message)
Definition websocket.cc:226
Role
Definition websocket.h:20
std::string_view bytes
Definition exports.cc:76
Definition websocket.h:22
std::function< absl::StatusOr< std::array< std::uint8_t, 4 > >()> mask_provider
Definition websocket.h:24
std::string path
Definition websocket.h:25
std::size_t maximum_message_bytes
Definition websocket.h:27
std::string authority
Definition websocket.h:26
std::size_t maximum_buffered_bytes
Definition websocket.h:28
Definition websocket.cc:15