Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

localAddr

localAddr: string

The local address of the connection.

remoteAddr

remoteAddr: string

The remote address of the connection.

rid

rid: number

The resource ID of the connection.

Methods

close

  • close(): void

closeRead

  • closeRead(): void
  • Shuts down (shutdown(2)) the reading side of the TCP connection. Most callers should just use close().

    Returns void

closeWrite

  • closeWrite(): void
  • Shuts down (shutdown(2)) the writing side of the TCP connection. Most callers should just use close().

    Returns void

read

  • read(p: Uint8Array): Promise<number | EOF>
  • Reads up to p.byteLength bytes into p. It resolves to the number of bytes read (0 < n <= p.byteLength) and rejects if any error encountered. Even if read() returns n < p.byteLength, it may use all of p as scratch space during the call. If some data is available but not p.byteLength bytes, read() conventionally returns what is available instead of waiting for more.

    When read() encounters end-of-file condition, it returns EOF symbol.

    When read() encounters an error, it rejects with an error.

    Callers should always process the n > 0 bytes returned before considering the EOF. Doing so correctly handles I/O errors that happen after reading some bytes and also both of the allowed EOF behaviors.

    Implementations must not retain p.

    Parameters

    • p: Uint8Array

    Returns Promise<number | EOF>

write

  • write(p: Uint8Array): Promise<number>
  • Writes p.byteLength bytes from p to the underlying data stream. It resolves to the number of bytes written from p (0 <= n <= p.byteLength) and any error encountered that caused the write to stop early. write() must return a non-null error if it returns n < p.byteLength. write() must not modify the slice data, even temporarily.

    Implementations must not retain p.

    Parameters

    • p: Uint8Array

    Returns Promise<number>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc