Пример #1
0
        bool IsError(AsyncCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                lock (this.syncRoot)
                {
                    this.client.CloseAsync();
                    this.client = null;
                }
                this.AddNotification("ERROR: " + e.Error.Message);
            }

            return e.Error != null;
        }
Пример #2
0
        private void Connect(object s)
        {
            this.client = new ChatProxy.ChatServiceClient(new PollingDuplexHttpBinding { DuplexMode = PollingDuplexMode.MultipleMessagesPerPoll },
               new EndpointAddress("../ChatService.svc"));
            this.client.NotifyReceived += new EventHandler<NotifyReceivedEventArgs>(client_NotifyReceived);
            this.client.PublishCompleted += new EventHandler<AsyncCompletedEventArgs>(client_PublishCompleted);
            this.client.SubscribeCompleted += new EventHandler<AsyncCompletedEventArgs>(client_SubscribeCompleted);

            this.client.SubscribeAsync(mutltiPlayerEnabled);
        }