Пример #1
0
        public void Close(string reason, GoodbyeDetails details)
        {
            reason  = reason ?? WampErrors.CloseNormal;
            details = details ?? EmptyGoodbyeDetails;

            mGoodbyeSent = true;
            mServerProxy.Goodbye(details, reason);
        }
Пример #2
0
        public void Goodbye(GoodbyeDetails details, string reason)
        {
            if (!mGoodbyeSent)
            {
                mServerProxy.Goodbye(new GoodbyeDetails(), WampErrors.GoodbyeAndOut);
            }

            RaiseConnectionBroken(SessionCloseType.Goodbye, details, reason);
        }
Пример #3
0
        public virtual void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason)
        {
            IWampClientProxy <TMessage> wampClient = client as IWampClientProxy <TMessage>;

            if (!wampClient.GoodbyeSent)
            {
                wampClient.SendGoodbye(details, WampErrors.CloseNormal);
            }
        }
Пример #4
0
        public void Goodbye(GoodbyeDetails details, string reason)
        {
            if (!mGoodbyeSent)
            {
                mServerProxy.Goodbye(new GoodbyeDetails(), WampErrors.GoodbyeAndOut);
            }

            TrySetCloseEventArgs(SessionCloseType.Goodbye, details, reason);
        }
Пример #5
0
        public virtual void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason)
        {
            using (IDisposable disposable = client as IDisposable)
            {
                client.Goodbye(details, WampErrors.CloseNormal);

                IWampClientProxy <TMessage> wampClient = client as IWampClientProxy <TMessage>;
                wampClient.GoodbyeSent = true;
                wampClient.Realm.Goodbye(wampClient.Session, details, reason);
            }
        }
Пример #6
0
        public override void Stop()
        {
            base.Stop();

            GoodbyeDetails details = new GoodbyeDetails();

            foreach (IWampClientProxy <TMessage> clientProxy in this.ClientContainer.GetAllClients())
            {
                clientProxy.SendGoodbye(details, WampErrors.SystemShutdown);
            }
        }
Пример #7
0
        public Task <GoodbyeMessage> Close(string reason, GoodbyeDetails details)
        {
            reason  = reason ?? WampErrors.CloseNormal;
            details = details ?? EmptyGoodbyeDetails;

            TaskCompletionSource <GoodbyeMessage> closeTask =
                new TaskCompletionSource <GoodbyeMessage>();

            mCloseTask = closeTask;

            mGoodbyeSent = true;
            mServerProxy.Goodbye(details, reason);

            return(closeTask.Task);
        }
Пример #8
0
        public void Goodbye(GoodbyeDetails details, string reason)
        {
            using (IDisposable proxy = mServerProxy as IDisposable)
            {
                if (!mGoodbyeSent)
                {
                    mServerProxy.Goodbye(new GoodbyeDetails(), WampErrors.GoodbyeAndOut);
                }
                else
                {
                    mGoodbyeMessage = new GoodbyeMessage()
                    {
                        Details = details, Reason = reason
                    };
                }
            }

            TrySetCloseEventArgs(SessionCloseType.Goodbye, details, reason);
        }
Пример #9
0
        private static int KillSessionList(long callerId, IEnumerable <IWampSessionTerminator> list, string reason,
                                           string message)
        {
            WampSessionClientTerminator callerTerminator =
                new WampSessionClientTerminator(callerId);

            GoodbyeDetails goodbyeDetails =
                new GoodbyeDetails {
                Message = message
            };

            int count = 0;

            foreach (IWampSessionTerminator terminator in list)
            {
                if (!callerTerminator.Equals(terminator))
                {
                    terminator.Disconnect(goodbyeDetails, reason);
                    count++;
                }
            }

            return(count);
        }
Пример #10
0
 public void Close(string reason, GoodbyeDetails details)
 {
     mClient.Close(reason, details);
 }
Пример #11
0
 public void Goodbye(long session, GoodbyeDetails details, string reason)
 {
     mRealmGate.Goodbye(session, details, reason);
 }
Пример #12
0
 public void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason)
 {
     throw new System.NotImplementedException();
 }
 public void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason)
 {
 }
Пример #14
0
 public void Goodbye(GoodbyeDetails details, string reason)
 {
     Send(mGoodbye2, details, reason);
 }
 public override void Disconnect(GoodbyeDetails details, string reason)
 {
     mClientProxy.SendGoodbye(details, reason);
 }
Пример #16
0
 public virtual void Goodbye(IWampSessionClient client, GoodbyeDetails details, string reason)
 {
     mSession.Goodbye(client, details, reason);
 }
Пример #17
0
 public void Goodbye(long session, GoodbyeDetails details, string reason)
 {
     RaiseSessionClosed(SessionCloseType.Goodbye, session, details, reason);
 }
Пример #18
0
 public void Disconnect(GoodbyeDetails details, string reason)
 {
     mParent.Close(reason, details);
 }
Пример #19
0
 public Task <GoodbyeMessage> Close(string reason, GoodbyeDetails details)
 {
     return(SessionClient.Close(reason, details));
 }
Пример #20
0
 public void Goodbye(GoodbyeDetails details, string reason)
 {
     SessionClient.Goodbye(details, reason);
 }
Пример #21
0
 public static void SendGoodbye <TMessage>(this IWampClientProxy <TMessage> clientProxy, GoodbyeDetails details, string reason)
 {
     using (clientProxy as IDisposable)
     {
         clientProxy.GoodbyeSent = true;
         clientProxy.Goodbye(details, reason);
         clientProxy.Realm.Goodbye(clientProxy.Session, details, reason);
     }
 }