Definition object for the functionality of the Socket.
Creates an instance of the Tocket SocketServer.
the Port the WebSocket will be listening on.
an Object of custom data that will be made accessible to all endpoints
Optional server: Server<typeof IncomingMessage, typeof ServerResponse>If you are using an https server you can inject it here.
number of milliseconds to wait for an endpoint to answer a message
by default ISO datetime strings will automatically be parsed into Date objects, set to false to disable this behavior.
Private Readonly keepby default ISO datetime strings will automatically be parsed into Date objects, set to false to disable this behavior.
Access the CustomData object of this Socket.
Optional key: KThe key of the CustomData property to fetch. If left out the entire CustomData Object is returned.
Either the content of the CustomData property or the CustomData Object
Fetch all or a subset of current connections of the Socket, optionally narrowed by a filter.
Optional arg: ConnectionFilter<NonNullable<Connector<S>>>a Filter for the connections to be fetched. If left empty, all connections are returned.
Registers a communication preset.
identifier of this preset.
Optional handlerName: stringname of the handler function on the target Socket this should process the messages
Optional defaultTarget: ConnectionFilter<NonNullable<Connector<S>>>identifier of the Socket the communication should target. uses the 'main' socket by default
the generated Communication preset.
Client id generated by the server, empty in the Base and Server versions of the class
Protected customReadonly defaultPlaceholder for the default custom Data method
The handler function
Readonly defaultPlaceholder for the default identity method
The handler function
Protected _launchLaunch a previously registered communication preset.
the name of the communication preset to start
Optional content: DefBack<S, N, "content">the data used to initialize the connection.
Optional targetFilter: ConnectionFilter<NonNullable<Connector<S>>>the identifier of the endpoint this should receive this message
Stringify Received Data
The Received Data
Providing the communication method with smart and typed parameter functions.
Name of preset
handler name
targetName
Optional pID: stringPID instance
The finished method handler
Protected makeUUIDPrivate onmessageModifies custom data on a Socket or Client. All connected Sockets and Clients receive the change immediately.
name of the property to set
new value of the property
Protected connectionsProtected presetsMap holding all communication presets registered to the Socket
Protected promiseGenerated using TypeDoc
The Server instance of Tocket. Meant to run in Node, not in the browser.