Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MailBox

Hierarchy

  • EventEmitter
    • MailBox

Index

Constructors

constructor

Properties

_interval

_interval: Timer

bufferMsg

bufferMsg: boolean

closed

closed: boolean = false

connected

connected: boolean = false

curId

curId: number = 0

host

host: string

id

id: string

interval

interval: number

keepalive

keepalive: number

keepaliveTimer

keepaliveTimer: Timer

lastPing

lastPing: number = -1

lastPong

lastPong: number = -1

opts

opts: any

port

port: number

queue

queue: MailBoxMessage[] = []

requests

requests: object

Type declaration

serverId

serverId: string

socket

socket: any

timeout

timeout: object

Type declaration

  • [id: number]: Timer

timeoutValue

timeoutValue: any

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

checkKeepAlive

  • checkKeepAlive(): void

clearCbTimeout

  • clearCbTimeout(id: number): void

close

  • close(): void

connect

  • connect(tracer: Tracer, cb: function): void

doSend

  • doSend(socket: any, msg: object): void

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

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

    Returns boolean

enqueue

eventNames

  • eventNames(): Array<string | symbol>
  • Returns Array<string | symbol>

flush

  • flush(): void

getMaxListeners

  • getMaxListeners(): number
  • Returns number

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

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

    • event: string | symbol

    Returns Function[]

on

  • on(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

once

  • once(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependListener

  • prependListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: function): this
  • Parameters

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

processMsg

processMsgs

removeAllListeners

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

    • Optional event: string | symbol

    Returns this

removeListener

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

    • event: string | symbol
    • listener: function
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns this

send

setCbTimeout

  • setCbTimeout(id: number, tracer: any, cb: Function): void

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setupKeepAlive

  • setupKeepAlive(): void

Static listenerCount

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

    • emitter: EventEmitter
    • event: string | symbol

    Returns number