I use setInterval X WebSockets

3

I'm developing a PHP application with AngularJS, in this application has a messaging system. I need only check the message quantity at least every 2 min. My doubts would be, would using the setInterval be recommended in this case, or would creating a socket be better? Since the update is only showing the user the amount of unread messages and this every 2 min.

    
asked by anonymous 08.12.2014 / 16:56

1 answer

0

In your case I recommend setInterval, knowing that the update interval is fixed, Socket will keep an open connection on your server, updating at all times, so I do not see the need to use it!

    
08.12.2014 / 17:42