syncsocket-client v0.2.10
SyncSocket-client
Synchronized messaging application framework client
API Docs
Channel
Channel constructor
Parameters
connectionspecObject Connection options
subscribe
Subscribes for messages on given topic.
Subscribing to topic # will make you subscribe to any message in the channel.
Parameters
topicstringprepareCallbackfunction (Any): Any The callback called during prepare transitionfireCallbackfunction (Any): Any The callback called during the 'fire' event
publish
Publishes a user message to the channel
Parameters
Channel#transition
Channel switched state
Properties
Channel#error
Error in channel
Channel#syncSuccessful
Synchronization with timeserver succeeded
Properties
errornumber Reading's max variation from truth (ms)adjustnumber Difference between local and remote clocks (ms)
Channel#syncFailed
Synchronization with timeserver failed
Properties
errornumber Reading's max variation from truth (ms)adjustnumber Difference between local and remote clocks (ms)
Connection
Creates new Connection object
Parameters
uriURI of SyncSocket server (e.g. http://localhost:5579)
close
Disconnects from the server
joinChannel
Attempt joining a channel with id channelId.
Parameters
channelIdcanPublish
Returns Promise Fulfilled promise returns the Channel object, rejected — error message.
Connection#connected
Client successfully connected to server
Connection#error
Connection error
Connection#disconnected
Client disconnected from server
Connection#connection-error
Error while connecting to server
connect
Attempts connection to a SyncSocket server.
Parameters
uristring Server URI
Returns Connection Connection object.
connect
Attempts connection to a SyncSocket server.
Parameters
uristring Server URI
Returns Connection Connection object.
Connection
Creates new Connection object
Parameters
uriURI of SyncSocket server (e.g. http://localhost:5579)
close
Disconnects from the server
joinChannel
Attempt joining a channel with id channelId.
Parameters
channelIdcanPublish
Returns Promise Fulfilled promise returns the Channel object, rejected — error message.
Channel
Channel constructor
Parameters
connectionspecObject Connection options
subscribe
Subscribes for messages on given topic.
Subscribing to topic # will make you subscribe to any message in the channel.
Parameters
topicstringprepareCallbackfunction (Any): Any -- The callback called during prepare transitionfireCallbackfunction (Any): Any -- The callback called during the 'fire' event
publish
Publishes a user message to the channel
Parameters