Server | typescript
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

connections

connections: number

maxConnections

maxConnections: number

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string, listener: Function): this
  • addListener(event: "close", listener: function): this
  • addListener(event: "connection", listener: function): this
  • addListener(event: "error", listener: function): this
  • addListener(event: "listening", listener: function): this
  • events.EventEmitter

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

    Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • Returns void

    Returns this

address

  • address(): object
  • Returns object

    • address: string
    • family: string
    • port: number

close

  • close(callback?: Function): Server
  • Parameters

    • Optional callback: Function

    Returns Server

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • emit(event: "close"): boolean
  • emit(event: "connection", socket: Socket): boolean
  • emit(event: "error", err: Error): boolean
  • emit(event: "listening"): boolean
  • Parameters

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

    Returns boolean

  • Parameters

    • event: "close"

    Returns boolean

  • Parameters

    • event: "connection"
    • socket: Socket

    Returns boolean

  • Parameters

    • event: "error"
    • err: Error

    Returns boolean

  • Parameters

    • event: "listening"

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]

getConnections

  • getConnections(cb: function): void
  • Parameters

    • cb: function
        • (error: Error, count: number): void
        • Parameters

          • error: Error
          • count: number

          Returns void

    Returns void

getMaxListeners

  • getMaxListeners(): number

listen

  • listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server
  • listen(port: number, hostname?: string, listeningListener?: Function): Server
  • listen(port: number, backlog?: number, listeningListener?: Function): Server
  • listen(port: number, listeningListener?: Function): Server
  • listen(path: string, backlog?: number, listeningListener?: Function): Server
  • listen(path: string, listeningListener?: Function): Server
  • listen(options: ListenOptions, listeningListener?: Function): Server
  • listen(handle: any, backlog?: number, listeningListener?: Function): Server
  • listen(handle: any, listeningListener?: Function): Server
  • Parameters

    • port: number
    • Optional hostname: string
    • Optional backlog: number
    • Optional listeningListener: Function

    Returns Server

  • Parameters

    • port: number
    • Optional hostname: string
    • Optional listeningListener: Function

    Returns Server

  • Parameters

    • port: number
    • Optional backlog: number
    • Optional listeningListener: Function

    Returns Server

  • Parameters

    • port: number
    • Optional listeningListener: Function

    Returns Server

  • Parameters

    • path: string
    • Optional backlog: number
    • Optional listeningListener: Function

    Returns Server

  • Parameters

    • path: string
    • Optional listeningListener: Function

    Returns Server

  • Parameters

    Returns Server

  • Parameters

    • handle: any
    • Optional backlog: number
    • Optional listeningListener: Function

    Returns Server

  • Parameters

    • handle: any
    • Optional listeningListener: Function

    Returns Server

listenerCount

  • listenerCount(type: string | symbol): number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string, listener: Function): this
  • on(event: "close", listener: function): this
  • on(event: "connection", listener: function): this
  • on(event: "error", listener: function): this
  • on(event: "listening", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • Returns void

    Returns this

once

  • once(event: string, listener: Function): this
  • once(event: "close", listener: function): this
  • once(event: "connection", listener: function): this
  • once(event: "error", listener: function): this
  • once(event: "listening", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • Returns void

    Returns this

prependListener

  • prependListener(event: string, listener: Function): this
  • prependListener(event: "close", listener: function): this
  • prependListener(event: "connection", listener: function): this
  • prependListener(event: "error", listener: function): this
  • prependListener(event: "listening", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string, listener: Function): this
  • prependOnceListener(event: "close", listener: function): this
  • prependOnceListener(event: "connection", listener: function): this
  • prependOnceListener(event: "error", listener: function): this
  • prependOnceListener(event: "listening", listener: function): this
  • Parameters

    • event: string
    • listener: Function

    Returns this

  • Parameters

    • event: "close"
    • listener: function
        • (): void
        • Returns void

    Returns this

  • Parameters

    • event: "connection"
    • listener: function
        • Parameters

          Returns void

    Returns this

  • Parameters

    • event: "error"
    • listener: function
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns this

  • Parameters

    • event: "listening"
    • listener: function
        • (): void
        • Returns void

    Returns this

ref

  • Returns Server

removeAllListeners

  • removeAllListeners(event?: string | symbol): this

removeListener

  • removeListener(event: string | symbol, listener: Function): this

setMaxListeners

  • setMaxListeners(n: number): this

unref

  • Returns Server

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    Returns 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