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";
44 static absl::StatusOr<std::unique_ptr<WebSocket>>
Create(
50 absl::Status
Feed(std::string_view
bytes);
52 absl::Status
Send(std::string_view message);
53 absl::StatusOr<std::optional<std::string>>
Receive();
62 explicit WebSocket(std::unique_ptr<State> state);
63 std::unique_ptr<State> state_;
Single-owner RFC 8441 WebSocket endpoint over nghttp2.
Definition websocket.h:42
bool closed() const
Definition websocket.cc:273
absl::StatusOr< std::string > TakeOutput()
Definition websocket.cc:211
std::size_t buffered_amount() const
Definition websocket.cc:277
WebSocket & operator=(const WebSocket &)=delete
void Abort()
Definition websocket.cc:265
absl::StatusOr< std::optional< std::string > > Receive()
Definition websocket.cc:232
absl::Status Close()
Definition websocket.cc:246
WebSocket(const WebSocket &)=delete
absl::Status Feed(std::string_view bytes)
Definition websocket.cc:199
static absl::StatusOr< std::unique_ptr< WebSocket > > Create(Role role, Options options={})
Definition websocket.cc:173
bool open() const
Definition websocket.cc:269
absl::Status Send(std::string_view message)
Definition websocket.cc:218
Role
Definition websocket.h:20
std::string_view bytes
Definition exports.cc:74
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:11