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");
});
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.