Hello all)

I'm trying to create small web application which uses *WebSocket protocol* 
to exchange the data

Here is my angular *service*

define(function () {


    return function (module) {
        return module.service("socketService", function($q, $timeout) {


            var service = {},
                listener = $q.defer(),
                socket = {
                    client: null,
                    stomp: null
                };


            service.RECONNECT_TIMEOUT = 30000;
            service.SOCKET_URL = "/service/booking";
            service.CHAT_TOPIC = "/service/booking/updates";
            service.CHAT_BROKER = "/service/booking";


            service.receive = function() {
                return listener.promise;
            };


            ...
            return service;
       });
   };
});

and also *controller *code

define(function () {
    return function (module) {
            socketService.receive().then(null, null, function(message) { 
                $scope.list.countDownTimer = 0;
                if(message.resourceId === parseInt($routeParams.resourceId)) 
{
                    $scope.list.bookings = [];
                }   
                ...     
            });

My problem is that *socketService.receive()* function is invoked many times 
and the amount of this invocations is not repeatable: it might be 2 times, 
27 or even 110.

One more thing that I should add is that I think that is somehow dependent 
with amount of users who tests and clicks on the application

Could anyone help? Thank you in advance...


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to