You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rpcserver.md 3.3KB

Class: RPCServer <InterfaceT>

Type parameters

InterfaceT: T.RPCInterface

Hierarchy

  • RPCServer

Index

Constructors

Properties

Methods

Constructors

constructor

+ new RPCServer(exporters: T.ExporterArray‹InterfaceT›, conf: T.ServerConf‹InterfaceT›): RPCServer

Parameters:

Name Type Default Description
exporters T.ExporterArray‹InterfaceT› [] A list of RPCExporter to publish
conf T.ServerConf‹InterfaceT› {} A {@link SocketConf} object with optional settings

Returns: RPCServer

Properties

Private accessFilter

accessFilter: T.AccessFilter‹InterfaceT›


Private attached

attached: boolean = false


Private closeHandler

closeHandler: T.CloseHandler


Private conf

conf: T.ServerConf‹InterfaceT›


Private connectionHandler

connectionHandler: T.ConnectionHandler


Private errorHandler

errorHandler: function

Type declaration:

▸ (socket: Socket, error: any, rpcName: string, args: any[], forward?: undefined | false | true): void

Parameters:

Name Type
socket Socket
error any
rpcName string
args any[]
forward? undefined | false | true

Private exporters

exporters: T.ExporterArray‹InterfaceT›


Private pio

pio: PromiseIO = new PromiseIO()


Private Optional sesame

sesame? : T.SesameFunction

Methods

attach

attach(httpServer: Server, options?: SocketIO.ServerOptions): RPCServer‹InterfaceT›

Parameters:

Name Type Default
httpServer Server new http.Server()
options? SocketIO.ServerOptions -

Returns: RPCServer‹InterfaceT›


close

close(): void

Returns: void


Protected initRPCs

initRPCs(clientSocket: Socket): void

Parameters:

Name Type
clientSocket Socket

Returns: void


listen

listen(port: number, options?: SocketIO.ServerOptions): RPCServer‹InterfaceT›

Parameters:

Name Type
port number
options? SocketIO.ServerOptions

Returns: RPCServer‹InterfaceT›