/* * Copyright (c) 2021, Dex♪ * Copyright (c) 2022, Ali Mohammad Pur * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include namespace WebSocket { class WebSocketImpl : public RefCounted { public: virtual ~WebSocketImpl(); virtual void connect(ConnectionInfo const&) = 0; virtual bool can_read_line() = 0; virtual ErrorOr read_line(size_t) = 0; virtual ErrorOr read(int max_size) = 0; virtual bool send(ReadonlyBytes) = 0; virtual bool eof() = 0; virtual void discard_connection() = 0; Function on_connected; Function on_connection_error; Function on_ready_to_read; protected: WebSocketImpl(); }; }