The Definition Object of this socket's functionality
Constructor implementation
The URL of the WebSocket Server
Data for holding this socket's state.
number of milliseconds to wait for the target socket to respond to messages
number of milliseconds to wait for the target socket on when initializing.
set to false if the server should be initialized at a later time.
Optional
mainServerLogging: LoggingTypesSets the logging level for the server
Decides if the Main Server is a third party WebSocket that needs to be intercepted.
Readonly
defaultReadonly
defaultAccess 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
Generics message interceptor
The Socket to target.
Either the name of the Communication preset that processed the message or true.
Used to decide if the message should be forwarded to the socket's default handling function if available.
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.
Registers socket
the name of the targeted endpoint.
WebSocket ws or wss URL
How long to wait for the endpoint to respond
Optional
initialized: booleanShould the connection be initialized at a later time?
Optional
logging: LoggingTypeswhich messages should be logged?
The created SocketWrapper
Removes a Socket from the connections map.
The name of the connection to remove.
true if the Socket was removed, false if it didn't exist.
Client id generated by the server, empty in the Base and Server versions of the class
Protected
customProtected
_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
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
makeUUIDModifies 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
This is base a WebSocket client that is connected to at least one webSocket server. This class is not meant to be used directly, instead use the derived TocketClientNode or TocketClientBrowser classes depending on your Environment.