Search Results for

    Show / Hide Table of Contents

    Class WebSocketDecoder

    Reassembles raw bytes relayed after a WebSocket upgrade (see SessionEventArgs.WebSocketDecoderSend/WebSocketDecoderReceive, fed from the session's DataSent/DataReceived events) into individual WebSocketFrames, handling frames split across multiple reads and unmasking masked (client-to-server) payloads. Use one instance per direction of a single connection - frames may span calls, so state from one call feeds the next.

    Inheritance
    object
    WebSocketDecoder
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Titanium.Web.Proxy
    Assembly: Titanium.Web.Proxy.dll
    Syntax
    public class WebSocketDecoder

    Methods

    | Edit this page View Source

    Decode(byte[], int, int)

    Decodes as many complete frames as data currently contains (0 or more - any trailing partial frame is buffered internally and completed by a later call).

    Declaration
    public IEnumerable<WebSocketFrame> Decode(byte[] data, int offset, int count)
    Parameters
    Type Name Description
    byte[] data
    int offset
    int count
    Returns
    Type Description
    IEnumerable<WebSocketFrame>
    Remarks

    Every yielded WebSocketFrame's Data is an owned copy of the unmasked payload, safe to retain after this method returns. Remaining incomplete frame bytes stay in this decoder's internal reassembly buffer for a later call.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX