Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConnectorComponent

Connector component. Receive client requests and attach session with socket.

param

current application context

param

attach parameters opts.connector {Object} provides low level network and protocol details implementation between server and clients.

Hierarchy

  • ConnectorComponent

Implements

Index

Constructors

constructor

Properties

app

blacklist

blacklist: string[] = []

blacklistFun

blacklistFun: BlackListFunction

connection

connection: ConnectionService

connector

connector: IConnector

decode

decode: IDecoder

encode

encode: IEncoder

keys

keys: object

Type declaration

name

name: string = "__connector__"

server

session

useAsyncCoder

useAsyncCoder: boolean

useCrypto

useCrypto: boolean

useHostFilter

useHostFilter: boolean

Methods

afterStart

  • afterStart(cb: function): void

bindEvents

  • bindEvents(socket: ISocket): void

checkServerType

  • checkServerType(route: string): string

doHandleMessage

  • doHandleMessage(dmsg: any, session: Session): void

doSend

  • doSend(reqId: number, route: string, emsg: any, recvs: SID[], opts: ScheduleOptions, cb: function): void

getPubKey

  • getPubKey(id: number): RsaKey

getSession

handleMessage

  • handleMessage(session: Session, msg: any): void

handleMessageAsync

  • handleMessageAsync(msg: any, session: Session, socket: ISocket): void

hostFilter

  • hostFilter(cb: function, socket: ISocket): boolean

onSessionClose

send

  • send(reqId: number, route: string, msg: any, recvs: SID[], opts: ScheduleOptions, cb: function): void
  • Parameters

    • reqId: number
    • route: string
    • msg: any
    • recvs: SID[]
    • opts: ScheduleOptions
    • cb: function
        • (err?: Error, resp?: any): void
        • Parameters

          • Optional err: Error
          • Optional resp: any

          Returns void

    Returns void

sendAsync

  • sendAsync(reqId: number, route: string, msg: any, recvs: SID[], opts: ScheduleOptions, cb: function): void
  • Parameters

    • reqId: number
    • route: string
    • msg: any
    • recvs: SID[]
    • opts: ScheduleOptions
    • cb: function
        • (err?: Error, resp?: any): void
        • Parameters

          • Optional err: Error
          • Optional resp: any

          Returns void

    Returns void

setPubKey

  • setPubKey(id: number, key: object): void

start

  • start(cb: function): void

stop

  • stop(force: boolean, cb: function): void

verifyMessage

  • verifyMessage(session: Session, msg: any): any