Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TCPMailBox

Hierarchy

  • EventEmitter
    • TCPMailBox

Index

Constructors

constructor

  • new TCPMailBox(server: object, opts: MailBoxOpts): TCPMailBox

Properties

_interval

_interval: any

bufferMsg

bufferMsg: any

closed

closed: boolean = false

composer

composer: any

connected

connected: boolean = false

curId

curId: number = 0

host

host: Function

id

id: number

interval

interval: number

opts

opts: any

port

port: string

queue

queue: Array<any> = []

requests

requests: object

Type declaration

  • [key: string]: any

serverId

serverId: string

socket

socket: any = null

timeout

timeout: object

Type declaration

  • [key: string]: any

timeoutValue

timeoutValue: number

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

clearCbTimeout

  • clearCbTimeout(mailbox: TCPMailBox, id: number): void

close

  • close(): void

connect

  • connect(tracer: Tracer, cb: function): 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

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

  • processMsg(mailbox: TCPMailBox, pkg: MailBoxPkg): void

processMsgs

  • processMsgs(mailbox: TCPMailBox, pkgs: Array<MailBoxPkg>): void

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

  • send(tracer: Tracer, msg: Msg, opts: MailBoxOpts, cb: function): void
  • send message to remote server

    Parameters

    • tracer: Tracer
    • msg: Msg
    • opts: MailBoxOpts

      attach info to send method

    • cb: function

      declaration decided by remote interface

        • (tracer: Tracer, msg?: any, cb?: Function): void
        • Parameters

          • tracer: Tracer
          • Optional msg: any
          • Optional cb: Function

          Returns void

    Returns void

setCbTimeout

  • setCbTimeout(mailbox: TCPMailBox, id: number, tracer: Tracer, cb: function): void

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

Static listenerCount

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

    • emitter: EventEmitter
    • event: string | symbol

    Returns number