EgretDoc
Back to Home
Location:system/protocol.websocket

Module

Module documentation.

moduleprotocol.websocket

Classes

Classes and inheritance.

classprotocol.websocket::URL
@brief`URL` type.
@details`URL` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class URL {
    /*
    @brief `scheme` field.
classprotocol.websocket::Frame
@brief`Frame` type.
@details`Frame` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Frame {
    /*
    @brief `fin` field.

Functions

Free functions and class methods.

functionprotocol.websocket::guid
Signaturefunc guid() -> String
func guid() -> String {
    return "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
}
@briefProvides the system library operation `guid`.
@detailsExecutes the `guid` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `String`.
functionprotocol.websocket::opcode_continuation
Signaturefunc opcode_continuation() -> Int
func opcode_continuation() -> Int {
    return 0;
}
@briefProvides the system library operation `opcode_continuation`.
@detailsExecutes the `opcode_continuation` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::opcode_text
Signaturefunc opcode_text() -> Int
func opcode_text() -> Int {
    return 1;
}
@briefProvides the system library operation `opcode_text`.
@detailsExecutes the `opcode_text` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::opcode_binary
Signaturefunc opcode_binary() -> Int
func opcode_binary() -> Int {
    return 2;
}
@briefProvides the system library operation `opcode_binary`.
@detailsExecutes the `opcode_binary` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::opcode_close
Signaturefunc opcode_close() -> Int
func opcode_close() -> Int {
    return 8;
}
@briefProvides the system library operation `opcode_close`.
@detailsExecutes the `opcode_close` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::opcode_ping
Signaturefunc opcode_ping() -> Int
func opcode_ping() -> Int {
    return 9;
}
@briefProvides the system library operation `opcode_ping`.
@detailsExecutes the `opcode_ping` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::opcode_pong
Signaturefunc opcode_pong() -> Int
func opcode_pong() -> Int {
    return 10;
}
@briefProvides the system library operation `opcode_pong`.
@detailsExecutes the `opcode_pong` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::byte
Signaturefunc byte(n: Int) -> String
func byte(n: Int) -> String {
    return encoding.byte_from_code(n & 255);
}
@briefProvides the system library operation `byte`.
@detailsExecutes the `byte` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • nCount, size, or limit value.
@returnReturns the operation result as `String`.
functionprotocol.websocket::byte_at
Signaturefunc byte_at(s: String, idx: Int) -> Int
func byte_at(s: String, idx: Int) -> Int {
    return std.byte_at(s, idx) & 255;
}
@briefProvides the system library operation `byte_at`.
@detailsExecutes the `byte_at` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • idxZero-based index.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::u16_be
Signaturefunc u16_be(n: Int) -> String
func u16_be(n: Int) -> String {
    return byte((n >> 8) & 255) + byte(n & 255);
}
@briefProvides the system library operation `u16_be`.
@detailsExecutes the `u16_be` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • nCount, size, or limit value.
@returnReturns the operation result as `String`.
functionprotocol.websocket::u64_be
Signaturefunc u64_be(n: Int) -> String
func u64_be(n: Int) -> String {
    return byte((n >> 56) & 255)
    + byte((n >> 48) & 255)
@briefProvides the system library operation `u64_be`.
@detailsExecutes the `u64_be` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • nCount, size, or limit value.
@returnReturns the operation result as `String`.
functionprotocol.websocket::read_u16_be
Signaturefunc read_u16_be(s: String, off: Int) -> Int
func read_u16_be(s: String, off: Int) -> Int {
    return (byte_at(s, off) << 8) | byte_at(s, off + 1);
}
@briefReads data with `read_u16_be`.
@detailsExecutes the `read_u16_be` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • offZero-based byte offset or element offset at which the operation starts.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::read_u64_be
Signaturefunc read_u64_be(s: String, off: Int) -> Int
func read_u64_be(s: String, off: Int) -> Int {
    let out: Int = 0;
    loop (let i: Int = 0; i < 8; i += 1) {
@briefReads data with `read_u64_be`.
@detailsExecutes the `read_u64_be` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • offZero-based byte offset or element offset at which the operation starts.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::find_substr_from
Signaturefunc find_substr_from(s: String, pat: String, start: Int) -> Int
func find_substr_from(s: String, pat: String, start: Int) -> Int {
    let n: Int = std.len(s);
    let m: Int = std.len(pat);
@briefFinds a matching position or element with `find_substr_from`.
@detailsExecutes the `find_substr_from` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
  • startZero-based starting index, byte offset, or range boundary for the operation.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::find_substr
Signaturefunc find_substr(s: String, pat: String) -> Int
func find_substr(s: String, pat: String) -> Int {
    return find_substr_from(s, pat, 0);
}
@briefFinds a matching position or element with `find_substr`.
@detailsExecutes the `find_substr` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • patPattern string used for matching keys, text, routes, or protocol fields.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::header_end
Signaturefunc header_end(raw: String) -> Int
func header_end(raw: String) -> Int {
    return find_substr(raw, "\r\n\r\n");
}
@briefProvides the system library operation `header_end`.
@detailsExecutes the `header_end` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • rawRaw encoded input string before validation, parsing, or normalization.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::URL.init
Signaturefunc init(self: protocol.websocket.URL, scheme: String = "", host: String = "", port: Int = 0, path: String = "/") -> Void
    func init(self: protocol.websocket.URL, scheme: String = "", host: String = "", port: Int = 0, path: String = "/") -> Void {
        self.scheme = scheme;
        self.host = host;
@briefInitializes a `URL` instance.
@detailsEstablishes the initial field state for `URL` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
  • schemeURL or protocol scheme such as `http`, `https`, or a database protocol name.
  • hostHost name or listen address.
  • portPort number.
  • pathFile or directory path.
@returnVoid
functionprotocol.websocket::URL.deinit
Signaturefunc deinit(self: protocol.websocket.URL) -> Void
    func deinit(self: protocol.websocket.URL) -> Void {
    }
}
@briefReleases fallback resources at the end of the `URL` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionprotocol.websocket::parse_url
Signaturefunc parse_url(raw_url: String) -> protocol.websocket.URL, ErrCode
func parse_url(raw_url: String) -> protocol.websocket.URL, ErrCode {
    let scheme_end: Int = find_substr(raw_url, "://");
    if scheme_end <= 0 {
@briefParses input data with `parse_url`.
@detailsExecutes the `parse_url` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • raw_urlURL string exactly as supplied by the caller before parsing or escaping.
@returnReturns `protocol.websocket.URL, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionprotocol.websocket::header_value
Signaturefunc header_value(raw: String, key: String) -> String
func header_value(raw: String, key: String) -> String {
    let key_lc: String = strings.to_lower_ascii(key);
    let line_start: Int = 0;
@briefProvides the system library operation `header_value`.
@detailsExecutes the `header_value` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • rawRaw encoded input string before validation, parsing, or normalization.
  • keyKey name.
@returnReturns the operation result as `String`.
functionprotocol.websocket::status_code
Signaturefunc status_code(resp: String) -> Int
func status_code(resp: String) -> Int {
    let line_end: Int = find_substr(resp, "\r\n");
    if line_end < 0 {
@briefProvides the system library operation `status_code`.
@detailsExecutes the `status_code` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • respResponse object or encoded response payload processed by the operation.
@returnReturns the operation result as `Int`.
functionprotocol.websocket::path_with_query
Signaturefunc path_with_query(path: String) -> String
func path_with_query(path: String) -> String {
    if std.len(path) == 0 {
        return "/";
@briefProvides the system library operation `path_with_query`.
@detailsExecutes the `path_with_query` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns the operation result as `String`.
functionprotocol.websocket::pseudo_random_bytes
Signaturefunc pseudo_random_bytes(n: Int) -> String
func pseudo_random_bytes(n: Int) -> String {
    let seed: Int = time.now_us();
    let out: String = "";
@briefProvides the system library operation `pseudo_random_bytes`.
@detailsExecutes the `pseudo_random_bytes` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • nCount, size, or limit value.
@returnReturns the operation result as `String`.
functionprotocol.websocket::make_client_key
Signaturefunc make_client_key() -> String
func make_client_key() -> String {
    return encoding.base64.encode_to_string(pseudo_random_bytes(16));
}
@briefProvides the system library operation `make_client_key`.
@detailsExecutes the `make_client_key` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `String`.
functionprotocol.websocket::accept_key
Signaturefunc accept_key(client_key: String) -> String
func accept_key(client_key: String) -> String {
    return encoding.base64.encode_to_string(crypto.sha1.sum(client_key + guid()));
}
@briefProvides the system library operation `accept_key`.
@detailsExecutes the `accept_key` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • client_keyKey name, key material, or key collection used by the operation.
@returnReturns the operation result as `String`.
functionprotocol.websocket::encode_client_handshake
Signaturefunc encode_client_handshake(host: String, path: String, key: String, protocol: String = "") -> String
func encode_client_handshake(host: String, path: String, key: String, protocol: String = "") -> String {
    let req: String = "GET " + path_with_query(path) + " HTTP/1.1\r\n";
    req += "Host: " + host + "\r\n";
@briefEncodes input data with `encode_client_handshake`.
@detailsExecutes the `encode_client_handshake` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hostHost name or listen address.
  • pathFile or directory path.
  • keyKey name.
  • protocolProtocol name or version selected for the network operation.
@returnReturns the operation result as `String`.
functionprotocol.websocket::validate_server_handshake
Signaturefunc validate_server_handshake(resp: String, key: String) -> ErrCode
func validate_server_handshake(resp: String, key: String) -> ErrCode {
    if status_code(resp) != 101 {
        return std.ERR_INVALID;
@briefProvides the system library operation `validate_server_handshake`.
@detailsExecutes the `validate_server_handshake` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • respResponse object or encoded response payload processed by the operation.
  • keyKey name.
@returnReturns `ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionprotocol.websocket::validate_client_handshake
Signaturefunc validate_client_handshake(req: String) -> String, ErrCode
func validate_client_handshake(req: String) -> String, ErrCode {
    let upgrade: String = strings.to_lower_ascii(header_value(req, "Upgrade"));
    let connection: String = strings.to_lower_ascii(header_value(req, "Connection"));
@briefProvides the system library operation `validate_client_handshake`.
@detailsExecutes the `validate_client_handshake` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • reqRequest object or request handle being encoded, sent, or processed.
@returnReturns `String, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionprotocol.websocket::encode_server_handshake
Signaturefunc encode_server_handshake(key: String, protocol: String = "") -> String
func encode_server_handshake(key: String, protocol: String = "") -> String {
    let resp: String = "HTTP/1.1 101 Switching Protocols\r\n";
    resp += "Upgrade: websocket\r\n";
@briefEncodes input data with `encode_server_handshake`.
@detailsExecutes the `encode_server_handshake` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • keyKey name.
  • protocolProtocol name or version selected for the network operation.
@returnReturns the operation result as `String`.
functionprotocol.websocket::Frame.init
Signaturefunc init(self: protocol.websocket.Frame, fin: Bool = true, opcode: Int = 0, payload: String = "", consumed: Int = 0) -> Void
    func init(self: protocol.websocket.Frame, fin: Bool = true, opcode: Int = 0, payload: String = "", consumed: Int = 0) -> Void {
        self.fin = fin;
        self.opcode = opcode;
@briefInitializes a `Frame` instance.
@detailsEstablishes the initial field state for `Frame` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
  • finWhether the protocol frame is marked as final.
  • opcodeProtocol opcode that identifies the frame or command type.
  • payloadPayload bytes or text carried by the protocol frame, request, or response.
  • consumedNumber of bytes, characters, or elements already consumed from the input.
@returnVoid
functionprotocol.websocket::Frame.deinit
Signaturefunc deinit(self: protocol.websocket.Frame) -> Void
    func deinit(self: protocol.websocket.Frame) -> Void {
    }
}
@briefReleases fallback resources at the end of the `Frame` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionprotocol.websocket::mask_payload
Signaturefunc mask_payload(payload: String, mask_key: String) -> String
func mask_payload(payload: String, mask_key: String) -> String {
    let out: String = "";
    loop (let i: Int = 0; i < std.len(payload); i += 1) {
@briefProvides the system library operation `mask_payload`.
@detailsExecutes the `mask_payload` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • payloadPayload bytes or text carried by the protocol frame, request, or response.
  • mask_keyKey name, key material, or key collection used by the operation.
@returnReturns the operation result as `String`.
functionprotocol.websocket::make_mask_key
Signaturefunc make_mask_key() -> String
func make_mask_key() -> String {
    return pseudo_random_bytes(4);
}
@briefProvides the system library operation `make_mask_key`.
@detailsExecutes the `make_mask_key` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `String`.
functionprotocol.websocket::encode_frame
Signaturefunc encode_frame(opcode: Int, payload: String, masked: Bool = false) -> String
func encode_frame(opcode: Int, payload: String, masked: Bool = false) -> String {
    let out: String = byte(128 | (opcode & 15));
    let payload_len: Int = std.len(payload);
@briefEncodes input data with `encode_frame`.
@detailsExecutes the `encode_frame` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • opcodeProtocol opcode that identifies the frame or command type.
  • payloadPayload bytes or text carried by the protocol frame, request, or response.
  • maskedWhether WebSocket payload masking is applied or expected.
@returnReturns the operation result as `String`.
functionprotocol.websocket::encode_text
Signaturefunc encode_text(text: String, masked: Bool = false) -> String
func encode_text(text: String, masked: Bool = false) -> String {
    return encode_frame(opcode_text(), text, masked);
}
@briefEncodes input data with `encode_text`.
@detailsExecutes the `encode_text` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • textText input to parse, encode, format, search, or transmit.
  • maskedWhether WebSocket payload masking is applied or expected.
@returnReturns the operation result as `String`.
functionprotocol.websocket::encode_binary
Signaturefunc encode_binary(data: String, masked: Bool = false) -> String
func encode_binary(data: String, masked: Bool = false) -> String {
    return encode_frame(opcode_binary(), data, masked);
}
@briefEncodes input data with `encode_binary`.
@detailsExecutes the `encode_binary` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • dataInput or output data buffer.
  • maskedWhether WebSocket payload masking is applied or expected.
@returnReturns the operation result as `String`.
functionprotocol.websocket::encode_close
Signaturefunc encode_close(payload: String = "", masked: Bool = false) -> String
func encode_close(payload: String = "", masked: Bool = false) -> String {
    return encode_frame(opcode_close(), payload, masked);
}
@briefEncodes input data with `encode_close`.
@detailsExecutes the `encode_close` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • payloadPayload bytes or text carried by the protocol frame, request, or response.
  • maskedWhether WebSocket payload masking is applied or expected.
@returnReturns the operation result as `String`.
functionprotocol.websocket::encode_ping
Signaturefunc encode_ping(payload: String = "", masked: Bool = false) -> String
func encode_ping(payload: String = "", masked: Bool = false) -> String {
    return encode_frame(opcode_ping(), payload, masked);
}
@briefEncodes input data with `encode_ping`.
@detailsExecutes the `encode_ping` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • payloadPayload bytes or text carried by the protocol frame, request, or response.
  • maskedWhether WebSocket payload masking is applied or expected.
@returnReturns the operation result as `String`.
functionprotocol.websocket::encode_pong
Signaturefunc encode_pong(payload: String = "", masked: Bool = false) -> String
func encode_pong(payload: String = "", masked: Bool = false) -> String {
    return encode_frame(opcode_pong(), payload, masked);
}
@briefEncodes input data with `encode_pong`.
@detailsExecutes the `encode_pong` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • payloadPayload bytes or text carried by the protocol frame, request, or response.
  • maskedWhether WebSocket payload masking is applied or expected.
@returnReturns the operation result as `String`.
functionprotocol.websocket::decode_frame
Signaturefunc decode_frame(buffer: String) -> protocol.websocket.Frame, ErrCode
func decode_frame(buffer: String) -> protocol.websocket.Frame, ErrCode {
    if std.len(buffer) < 2 {
        return new protocol.websocket.Frame(), std.ERR_EOF;
@briefDecodes input data with `decode_frame`.
@detailsExecutes the `decode_frame` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • bufferBuffer used to read, write, encode, or store intermediate data.
@returnReturns `protocol.websocket.Frame, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.

Variables

Class fields (var).

varprotocol.websocket::URL.scheme
TypeString
@brief`scheme` field.
@detailsHolds the `scheme` value for each `URL` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
    var scheme: String;
    /*
    @brief `host` field.
varprotocol.websocket::URL.host
TypeString
@brief`host` field.
@detailsStores a host name or network address. The field type is `String`, and it is maintained by the constructors and methods of `URL`.
    var host: String;
    /*
    @brief `port` field.
varprotocol.websocket::URL.port
TypeInt
@brief`port` field.
@detailsStores a port number. The field type is `Int`, and it is maintained by the constructors and methods of `URL`.
    var port: Int;
    /*
    @brief `path` field.
varprotocol.websocket::URL.path
TypeString
@brief`path` field.
@detailsStores the associated filesystem path. The field type is `String`, and it is maintained by the constructors and methods of `URL`.
    var path: String;

    /*
varprotocol.websocket::Frame.fin
TypeBool
@brief`fin` field.
@detailsHolds the `fin` value for each `Frame` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
    var fin: Bool;
    /*
    @brief `opcode` field.
varprotocol.websocket::Frame.opcode
TypeInt
@brief`opcode` field.
@detailsHolds the `opcode` value for each `Frame` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
    var opcode: Int;
    /*
    @brief `payload` field.
varprotocol.websocket::Frame.payload
TypeString
@brief`payload` field.
@detailsHolds the `payload` value for each `Frame` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
    var payload: String;
    /*
    @brief `consumed` field.
varprotocol.websocket::Frame.consumed
TypeInt
@brief`consumed` field.
@detailsHolds the `consumed` value for each `Frame` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
    var consumed: Int;

    /*