Hierarchy

Constructors

Properties

bufferSize: number
bytesRead: number
bytesWritten: number
connecting: boolean
destroyed: boolean
localAddress: string
localPort: number
readable: boolean
readableEncoding: null | BufferEncoding
readableEnded: boolean
readableFlowing: null | boolean
readableHighWaterMark: number
readableLength: number
readableObjectMode: boolean
remoteAddress?: string
remoteFamily?: string
remotePort?: number
writable: boolean
writableCorked: number
writableEnded: boolean
writableFinished: boolean
writableHighWaterMark: number
writableLength: number
writableObjectMode: boolean
captureRejectionSymbol: typeof captureRejectionSymbol
captureRejections: boolean

Sets or gets the default captureRejection value for all emitters.

defaultMaxListeners: number
errorMonitor: typeof errorMonitor

This symbol shall be used to install a listener for only monitoring 'error' events. Listeners installed using this symbol are called before the regular 'error' listeners are called.

Installing a listener using this symbol does not change the behavior once an 'error' event is emitted, therefore the process will still crash if no regular 'error' listener is installed.

Methods

  • Parameters

    • error: null | Error
    • callback: ((error) => void)
        • (error): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • callback: ((error?) => void)
        • (error?): void
        • Parameters

          • Optional error: null | Error

          Returns void

    Returns void

  • Parameters

    • size: number

    Returns void

  • Parameters

    • chunk: any
    • encoding: string
    • callback: ((error?) => void)
        • (error?): void
        • Parameters

          • Optional error: null | Error

          Returns void

    Returns void

  • Parameters

    • chunks: {
          chunk: any;
          encoding: string;
      }[]
    • callback: ((error?) => void)
        • (error?): void
        • Parameters

          • Optional error: null | Error

          Returns void

    Returns void

  • events.EventEmitter

    1. close
    2. connect
    3. data
    4. drain
    5. end
    6. error
    7. lookup
    8. timeout

    Parameters

    • event: string
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Socket

  • Parameters

    • event: "close"
    • listener: ((had_error) => void)
        • (had_error): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns Socket

  • Parameters

    • event: "connect"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "data"
    • listener: ((data) => void)
        • (data): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "drain"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "end"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "error"
    • listener: ((err) => void)
        • (err): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "lookup"
    • listener: ((err, address, family, host) => void)
        • (err, address, family, host): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns Socket

  • Parameters

    • event: "timeout"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • options: SocketConnectOpts
    • Optional connectionListener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • port: number
    • host: string
    • Optional connectionListener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • port: number
    • Optional connectionListener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • path: string
    • Optional connectionListener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Returns void

  • Parameters

    Returns void

  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

  • Parameters

    • event: "close"
    • had_error: boolean

    Returns boolean

  • Parameters

    • event: "connect"

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • event: "drain"

    Returns boolean

  • Parameters

    • event: "end"

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • event: "lookup"
    • err: Error
    • address: string
    • family: string | number
    • host: string

    Returns boolean

  • Parameters

    • event: "timeout"

    Returns boolean

  • Parameters

    • Optional cb: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • buffer: string | Uint8Array
    • Optional cb: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • str: string | Uint8Array
    • Optional encoding: string
    • Optional cb: (() => void)
        • (): void
        • Returns void

    Returns void

  • Returns (string | symbol)[]

  • Returns number

  • Returns boolean

  • Parameters

    • type: string | symbol

    Returns number

  • Parameters

    • event: string | symbol

    Returns Function[]

  • Parameters

    • event: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Socket

  • Parameters

    • event: string
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Socket

  • Parameters

    • event: "close"
    • listener: ((had_error) => void)
        • (had_error): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns Socket

  • Parameters

    • event: "connect"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "data"
    • listener: ((data) => void)
        • (data): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "drain"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "end"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "error"
    • listener: ((err) => void)
        • (err): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "lookup"
    • listener: ((err, address, family, host) => void)
        • (err, address, family, host): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns Socket

  • Parameters

    • event: "timeout"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: string
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Socket

  • Parameters

    • event: "close"
    • listener: ((had_error) => void)
        • (had_error): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns Socket

  • Parameters

    • event: "connect"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "data"
    • listener: ((data) => void)
        • (data): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "drain"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "end"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "error"
    • listener: ((err) => void)
        • (err): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "lookup"
    • listener: ((err, address, family, host) => void)
        • (err, address, family, host): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns Socket

  • Parameters

    • event: "timeout"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Type Parameters

    Parameters

    • destination: T
    • Optional options: {
          end?: boolean;
      }
      • Optional end?: boolean

    Returns T

  • Parameters

    • event: string
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Socket

  • Parameters

    • event: "close"
    • listener: ((had_error) => void)
        • (had_error): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns Socket

  • Parameters

    • event: "connect"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "data"
    • listener: ((data) => void)
        • (data): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "drain"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "end"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "error"
    • listener: ((err) => void)
        • (err): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "lookup"
    • listener: ((err, address, family, host) => void)
        • (err, address, family, host): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns Socket

  • Parameters

    • event: "timeout"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: string
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Socket

  • Parameters

    • event: "close"
    • listener: ((had_error) => void)
        • (had_error): void
        • Parameters

          • had_error: boolean

          Returns void

    Returns Socket

  • Parameters

    • event: "connect"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "data"
    • listener: ((data) => void)
        • (data): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "drain"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "end"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "error"
    • listener: ((err) => void)
        • (err): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "lookup"
    • listener: ((err, address, family, host) => void)
        • (err, address, family, host): void
        • Parameters

          • err: Error
          • address: string
          • family: string | number
          • host: string

          Returns void

    Returns Socket

  • Parameters

    • event: "timeout"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • chunk: any
    • Optional encoding: string

    Returns boolean

  • Parameters

    • event: string | symbol

    Returns Function[]

  • Parameters

    • Optional size: number

    Returns any

  • Returns Socket

  • Parameters

    • Optional event: string | symbol

    Returns Socket

  • Parameters

    • event: "close"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "data"
    • listener: ((chunk) => void)
        • (chunk): void
        • Parameters

          • chunk: any

          Returns void

    Returns Socket

  • Parameters

    • event: "end"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "error"
    • listener: ((err) => void)
        • (err): void
        • Parameters

          Returns void

    Returns Socket

  • Parameters

    • event: "pause"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "readable"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: "resume"
    • listener: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Parameters

    • event: string | symbol
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns Socket

  • Parameters

    • Optional encoding: string

    Returns Socket

  • Parameters

    • Optional enable: boolean
    • Optional initialDelay: number

    Returns Socket

  • Parameters

    • Optional noDelay: boolean

    Returns Socket

  • Parameters

    • timeout: number
    • Optional callback: (() => void)
        • (): void
        • Returns void

    Returns Socket

  • Returns void

  • Returns Socket

  • Parameters

    Returns void

  • Parameters

    • buffer: string | Uint8Array
    • Optional cb: ((err?) => void)
        • (err?): void
        • Parameters

          Returns void

    Returns boolean

  • Parameters

    • str: string | Uint8Array
    • Optional encoding: string
    • Optional cb: ((err?) => void)
        • (err?): void
        • Parameters

          Returns void

    Returns boolean

  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

    Deprecated

    since v4.0.0

  • Parameters

    Returns Promise<any[]>

  • Parameters

    Returns Promise<any[]>