kaios-types
    Preparing search index...

    Interface TCPSocket

    Represents a TCP socket connection. Available only if "mozilla::dom::TCPSocket::ShouldTCPSocketExist" is true. Exposed to: Window, System

    interface TCPSocket {
        binaryType: TCPSocketBinaryType;
        bufferedAmount: number;
        host: string;
        onclose: EventHandler;
        ondata: EventHandler;
        ondrain: EventHandler;
        onerror: EventHandler;
        onopen: EventHandler;
        port: number;
        readyState: TCPReadyState;
        ssl: boolean;
        addEventListener(
            type: string,
            callback: EventListenerOrEventListenerObject | null,
            options?: boolean | AddEventListenerOptions,
        ): void;
        close(): void;
        dispatchEvent(event: Event): boolean;
        removeEventListener(
            type: string,
            callback: EventListenerOrEventListenerObject | null,
            options?: boolean | EventListenerOptions,
        ): void;
        resume(): void;
        send(data: string): boolean;
        send(data: ArrayBuffer, byteOffset?: number, byteLength?: number): boolean;
        suspend(): void;
        upgradeToSecure(): void;
    }

    Hierarchy

    • EventTarget
      • TCPSocket
    Index

    Properties

    The type of binary data being used.

    bufferedAmount: number

    The amount of buffered data.

    host: string

    The remote host.

    onclose: EventHandler

    Event handler for socket close.

    ondata: EventHandler

    Event handler for incoming data.

    ondrain: EventHandler

    Event handler for when the buffer drains.

    onerror: EventHandler

    Event handler for errors.

    onopen: EventHandler

    Event handler for when the socket opens.

    port: number

    The remote port.

    readyState: TCPReadyState

    The current state of the socket.

    ssl: boolean

    Whether the connection is secure.

    Methods

    • The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.

      MDN Reference

      Parameters

      • type: string
      • callback: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

      MDN Reference

      Parameters

      • event: Event

      Returns boolean

    • The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.

      MDN Reference

      Parameters

      • type: string
      • callback: EventListenerOrEventListenerObject | null
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Sends data over the socket.

      Parameters

      • data: string

        The data string to send.

      Returns boolean

      True if written directly to kernel buffer, false if buffered in user space.

    • Sends data over the socket.

      Parameters

      • data: ArrayBuffer

        The binary data to send.

      • OptionalbyteOffset: number

        The offset in the buffer.

      • OptionalbyteLength: number

        The length of data to send.

      Returns boolean

      True if written directly to kernel buffer, false if buffered in user space.

    • Upgrades the connection to use secure transport (SSL/TLS).

      Returns void