mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 09:07:44 +00:00

SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
43 lines
962 B
C++
43 lines
962 B
C++
/*
|
|
* Copyright (c) 2021, The SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/ByteBuffer.h>
|
|
#include <AK/Span.h>
|
|
#include <AK/String.h>
|
|
#include <LibCore/Object.h>
|
|
#include <LibWebSocket/ConnectionInfo.h>
|
|
|
|
namespace WebSocket {
|
|
|
|
class AbstractWebSocketImpl : public Core::Object {
|
|
C_OBJECT_ABSTRACT(AbstractWebSocketImpl);
|
|
|
|
public:
|
|
virtual ~AbstractWebSocketImpl() override;
|
|
explicit AbstractWebSocketImpl(Core::Object* parent = nullptr);
|
|
|
|
virtual void connect(ConnectionInfo const&) = 0;
|
|
|
|
virtual bool can_read_line() = 0;
|
|
virtual String read_line(size_t size) = 0;
|
|
|
|
virtual bool can_read() = 0;
|
|
virtual ByteBuffer read(int max_size) = 0;
|
|
|
|
virtual bool send(ReadonlyBytes) = 0;
|
|
|
|
virtual bool eof() = 0;
|
|
|
|
virtual void discard_connection() = 0;
|
|
|
|
Function<void()> on_connected;
|
|
Function<void()> on_connection_error;
|
|
Function<void()> on_ready_to_read;
|
|
};
|
|
|
|
}
|