communication.layers.ioSocketServerLayer - ZeMA-gGmbH/NoPE-JS GitHub Wiki
communication.layers.ioSocketServerLayer
Mirror Layer using IO-Sockets.
Export
-
↳
ioSocketServerLayer
new ioSocketServerLayer(port, logger?, profile?)
Creates an instance of IoSocketMirrorServer.
Author
M.Karkowski
Memberof
IoSocketMirrorServer
| Name | Type | Default value | Description |
|---|---|---|---|
port |
number |
undefined |
Port the Server is running on. |
logger? |
ValidLoggerDefinition |
"info" |
|
profile |
boolean |
false |
- |
EventCommunicationInterface.constructor
connected: INopeObservable<boolean, boolean, boolean, IEventAdditionalData>
Flag, showing whether the Mirror is connected or not.
Memberof
EventMirror
EventCommunicationInterface.connected
id: string
ID of the Layer.
Author
M.Karkowski
Memberof
ICommunicationInterface
EventCommunicationInterface.id
port: number
Port the Server is running on.
Readonly receivesOwnMessages: boolean = true
Used to show, whether the the layer receives its own messages
Memberof
ICommunicationInterface
EventCommunicationInterface.receivesOwnMessages
detailListeners(type, listeners): void
Helper to detail the listeners of the "event", "rpc", "data" or "responses"
| Name | Type | Description |
|---|---|---|
type |
"event" | "rpc" | "data" | "response"
|
valid type to detail the name |
listeners |
string[] |
the currently used listeners. |
void
EventCommunicationInterface.detailListeners
dispose(): Promise<void>
Disconnect the Layer.
Memberof
ICommunicationInterface
Promise<void>
{Promise}
EventCommunicationInterface.dispose
emit<T>(eventname, data): Promise<void>
Function, which will be used to emit data
Memberof
EventMirror
| Name | Type |
|---|---|
T |
extends keyof EventnameToEventType
|
| Name | Type | Description |
|---|---|---|
eventname |
T |
- |
data |
EventnameToEventType[T] |
the data to emit |
Promise<void>
EventCommunicationInterface.emit
on<T>(eventname, cb): Promise<void>
Function which will be used to subscribe Data
Memberof
EventMirror
| Name | Type |
|---|---|
T |
extends keyof EventnameToEventType
|
| Name | Type |
|---|---|
eventname |
T |
cb |
(data: EventnameToEventType[T]) => void
|
Promise<void>