communication.layers.ioSocketServerLayer - ZeMA-gGmbH/NoPE-JS GitHub Wiki

Class: ioSocketServerLayer

communication.layers.ioSocketServerLayer

Mirror Layer using IO-Sockets.

Export

Hierarchy

Constructors

constructor

new ioSocketServerLayer(port, logger?, profile?)

Creates an instance of IoSocketMirrorServer.

Author

M.Karkowski

Memberof

IoSocketMirrorServer

Parameters

Name Type Default value Description
port number undefined Port the Server is running on.
logger? ValidLoggerDefinition "info"
profile boolean false -

Overrides

EventCommunicationInterface.constructor

Properties

connected

connected: INopeObservable<boolean, boolean, boolean, IEventAdditionalData>

Flag, showing whether the Mirror is connected or not.

Memberof

EventMirror

Inherited from

EventCommunicationInterface.connected


id

id: string

ID of the Layer.

Author

M.Karkowski

Memberof

ICommunicationInterface

Inherited from

EventCommunicationInterface.id


port

port: number

Port the Server is running on.


receivesOwnMessages

Readonly receivesOwnMessages: boolean = true

Used to show, whether the the layer receives its own messages

Memberof

ICommunicationInterface

Inherited from

EventCommunicationInterface.receivesOwnMessages

Methods

detailListeners

detailListeners(type, listeners): void

Helper to detail the listeners of the "event", "rpc", "data" or "responses"

Parameters

Name Type Description
type "event" | "rpc" | "data" | "response" valid type to detail the name
listeners string[] the currently used listeners.

Returns

void

Inherited from

EventCommunicationInterface.detailListeners


dispose

dispose(): Promise<void>

Disconnect the Layer.

Memberof

ICommunicationInterface

Returns

Promise<void>

{Promise}

Overrides

EventCommunicationInterface.dispose


emit

emit<T>(eventname, data): Promise<void>

Function, which will be used to emit data

Memberof

EventMirror

Type parameters

Name Type
T extends keyof EventnameToEventType

Parameters

Name Type Description
eventname T -
data EventnameToEventType[T] the data to emit

Returns

Promise<void>

Inherited from

EventCommunicationInterface.emit


on

on<T>(eventname, cb): Promise<void>

Function which will be used to subscribe Data

Memberof

EventMirror

Type parameters

Name Type
T extends keyof EventnameToEventType

Parameters

Name Type
eventname T
cb (data: EventnameToEventType[T]) => void

Returns

Promise<void>

Inherited from

EventCommunicationInterface.on

⚠️ **GitHub.com Fallback** ⚠️