-
Notifications
You must be signed in to change notification settings - Fork 9
Communication flow
jorishermans edited this page Nov 23, 2014
·
2 revisions
Here I will explain what the possibilities are of the communication flow.
The variable f can be ForceClient instance or a ForceServer instance.
The client and the server can do the following:
Send a simple message to the client, or to the server
f.send("request", somedata);
Send a simple message to the a specific client id
f.sendTo(wsId, "request", somedata);
You can also send a message to some profiles
f.sendToProfile('name', name, 'private', message);
When you are listening to messages you can easily reply to the sender.
fs.on("add", (vme, sender) {
sender.reply("update", "ok");
});