Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nowjs vs Socket.io

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?

like image 838
dzm Avatar asked Apr 06 '12 20:04

dzm


1 Answers

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

like image 69
drinchev Avatar answered Sep 24 '22 23:09

drinchev