Hierarchy

Constructors

  • Parameters

    • Optional connectionListener: ((socket) => void)
        • (socket): void
        • Parameters

          Returns void

    Returns Server

  • Parameters

    • Optional options: {
          allowHalfOpen?: boolean;
          pauseOnConnect?: boolean;
      }
      • Optional allowHalfOpen?: boolean
      • Optional pauseOnConnect?: boolean
    • Optional connectionListener: ((socket) => void)
        • (socket): void
        • Parameters

          Returns void

    Returns Server

Properties

connections: number
listening: boolean
maxConnections: number
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

  • events.EventEmitter

    1. close
    2. connection
    3. error
    4. listening

    Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

    • event: "connection"
    • listener: ((socket) => void)
        • (socket): void
        • Parameters

          Returns void

    Returns Server

  • Parameters

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

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Returns null | string | AddressInfo

  • Parameters

    • Optional callback: ((err?) => void)
        • (err?): void
        • Parameters

          Returns void

    Returns Server

  • Parameters

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

    Returns boolean

  • Parameters

    • event: "close"

    Returns boolean

  • Parameters

    • event: "connection"
    • socket: Socket

    Returns boolean

  • Parameters

    Returns boolean

  • Parameters

    • event: "listening"

    Returns boolean

  • Returns (string | symbol)[]

  • Parameters

    • cb: ((error, count) => void)
        • (error, count): void
        • Parameters

          • error: null | Error
          • count: number

          Returns void

    Returns void

  • Parameters

    • Optional port: number
    • Optional hostname: string
    • Optional backlog: number
    • Optional listeningListener: (() => void)
        • (): void
        • Returns void

    Returns Server

  • Parameters

    • Optional port: number
    • Optional hostname: string
    • Optional listeningListener: (() => void)
        • (): void
        • Returns void

    Returns Server

  • Parameters

    • Optional port: number
    • Optional backlog: number
    • Optional listeningListener: (() => void)
        • (): void
        • Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

    • path: string
    • Optional backlog: number
    • Optional listeningListener: (() => void)
        • (): void
        • Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

    • options: ListenOptions
    • Optional listeningListener: (() => void)
        • (): void
        • Returns void

    Returns Server

  • Parameters

    • handle: any
    • Optional backlog: number
    • Optional listeningListener: (() => void)
        • (): void
        • Returns void

    Returns Server

  • Parameters

    • handle: any
    • Optional listeningListener: (() => void)
        • (): void
        • Returns void

    Returns Server

  • 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 Server

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

    • event: "connection"
    • listener: ((socket) => void)
        • (socket): void
        • Parameters

          Returns void

    Returns Server

  • Parameters

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

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

    • event: "connection"
    • listener: ((socket) => void)
        • (socket): void
        • Parameters

          Returns void

    Returns Server

  • Parameters

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

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

    • event: "connection"
    • listener: ((socket) => void)
        • (socket): void
        • Parameters

          Returns void

    Returns Server

  • Parameters

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

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

    • event: "connection"
    • listener: ((socket) => void)
        • (socket): void
        • Parameters

          Returns void

    Returns Server

  • Parameters

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

          Returns void

    Returns Server

  • Parameters

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

    Returns Server

  • Parameters

    • event: string | symbol

    Returns Function[]

  • Returns Server

  • Parameters

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

          • Rest ...args: any[]

          Returns void

    Returns Server

  • Returns Server

  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

    Deprecated

    since v4.0.0

  • Parameters

    Returns Promise<any[]>

  • Parameters

    Returns Promise<any[]>