On Thursday, September 19, 2013 2:58:02 AM UTC-7, jose llopis wrote:
> i've done a push notification server on nodejs with socket.io and i have some 
> actions like
> 
> socket.on("message",processMessage);
> 
> and inside my processMessage function i 've done
> 
> socket.in("room").emit("sendData");
> 
> my question: 
> 
> i've read that simple push doesnt allow to send messages to push server... 
> 
> so how i can implement my simple push on firefox os to communicate with my 
> nodejs server

On your server, you should maintain a queue of messages for a particular 
client, or just have a common queue of messages and each client keeps track of 
message ids. Then you notify clients using push whenever a new message arrives, 
and they connect to the server and fetch the queue. It is important to remember 
that you should avoid using push when users are actively using the chat and 
frequently sending messages, since there will be more delay rather than just 
using the currently established connection between your server and application. 
It should fall back to push notifications only when you don't have an open 
connection to the client.

Nikhil
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to