Exemple #1
0
        //Note: no implementation of publish methods as it is done via the hub context...

        public override Task OnDisconnected(bool stopCalled)
        {
            try
            {
                var connectionEvent = CreateConnectionEvent("Disconnected");
                bus.Publish(connectionEvent);

                brokerConnectionManager.RemoveConnection(Context.ConnectionId);
            }
            catch (Exception exception)
            {
                messagingLogger.ErrorFormat(this, "There has been an exception: {0}", exception);
                throw;
            }
            return(base.OnDisconnected(stopCalled));
        }
        public bool Start()
        {
            lock (startLock)
            {
                try
                {
                    return(StartConnectionToHub());
                }
                catch (AggregateException e)
                {
                    messagingLogger.ErrorFormat(this, e.ToString());
                }
                catch (Exception e)
                {
                    messagingLogger.ErrorFormat(this, e.ToString());
                }

                return(false);
            }
        }