开发者

NodeJS And NowJs server and instant communication

I have just come across NodeJS and NowJS and I'm really interested in the technology. What I would like to do is, I would like to build an Facebook instant commenting-like application, where users comment on other's post and instantly appear on the other side. I have just seen the screencast about NowJS and NodeJS and I th开发者_如何学Cink that would do the job.

My understanding is you need build some kind of a webserver in NodeJs and use NowJs to listen/receive the message, so webserver.js (implemented in NodeJs) would be the a different webserver than jetty webserver and listen to different ports? And I have to run webserver.js separately.

My Question would be, If I do something on Jetty like receive some calculation on the browser and when it's finished send the message to webserver.js and it will distribute the message to all listening clients?


The short answer is yes. Jetty is working on the client and it's interaction with server is totally separate from Nowjs.

You could let Jetty do all the stuff and then update the Nowjs variable at the client-side. Nowjs will itself transfer the change to the server and further to all the rest of connected clients.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜