Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ServerTCP

Hierarchy

Implements

  • any

Index

Constructors

constructor

Properties

Private host

host: string

Private isExplicitlyTerminated

isExplicitlyTerminated: boolean = false

Protected logger

logger: any = new Logger(Server.name)

Protected messageHandlers

messageHandlers: any = new Map<string, MessageHandler>()

Private options

options: object

Type declaration

  • Optional host?: string
  • Optional port?: number
  • Optional retryAttempts?: number
  • Optional retryDelay?: number

Private port

port: number

Private retryAttemptsCount

retryAttemptsCount: number = 0

Private server

server: NetSocket

Methods

addHandler

  • addHandler(pattern: any, callback: MessageHandler, isEventHandler?: boolean): void

bindHandler

  • bindHandler(socket: Socket): void

close

  • close(): void

getHandlerByPattern

getHandlers

getOptionsProp

  • getOptionsProp<T, K>(obj: T, prop: K, defaultValue?: T[K]): T[K]

Private getSocketInstance

handleClose

  • handleClose(): undefined | number | NodeJS.Timer

Protected handleError

  • handleError(error: string): void

handleEvent

  • handleEvent(pattern: string, packet: ReadPacket): Promise<any>

handleMessage

Private init

  • init(): void

listen

  • listen(callback: function): void

Protected loadPackage

  • loadPackage<T>(name: string, ctx: string, loader?: Function): T

send

  • send(stream$: Observable<any>, respond: function): Subscription

transformToObservable

  • transformToObservable<T>(resultOrDeffered: any): Observable<T>

Generated using TypeDoc