Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Nowjs vs Socket.io

Nowjs vs Socket.io

Problem

I've been using socket.io with node.js and came across Nowjs, it seems this just wraps socket.io and provides a more user-friendly interface.

Once thing I've noticed with Socket.io is sometimes there is a Delay in connection, in IE and Firefox in particular, it can sometimes take 2-4 seconds before a 'connection' is established.

Does anyone know if there are any performance benefits or additional benefits in general to using Nowjs vs. Socket.io stand alone?

Problem courtesy of: dzm

Solution

NowJS supports clientId's and sessions, which would be easier for supporting multi-user real-time app. I think the both are practically the same and if you have some delay with socket.io, I really don't think it will disappear with nowJs.

I've switched to NowJS, because it's easier to structure your application ( for me ). I also experience a delay, but I think it is normal and since everything is async you could manage it in your script.

EDIT 1:

I discovered the cause of the delay. It seems that when NowJS is initialized it executes a lot of code to evaluate your "now" constructor, and synchronize it with the methods added from your server/client. In socket.io you have no such delay and it is faster

Update :

Nowjs is no longer in active development ( there are no recent updates and there probably won't be by the authors ). You should definitely look for something with greater support.

https://github.com/Flotype/now/issues/208

Solution courtesy of: drinchev

Discussion

View additional discussion.



This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

Nowjs vs Socket.io

×

Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription

×