コード例 #1
0
ファイル: IpcDevice.cs プロジェクト: stweily/Encore
        private void Disconnect()
        {
            var state = _client.State;

            if (state != CommunicationState.Closing && state != CommunicationState.Closed)
            {
                _client.Close();
            }

            _client = null;
        }
コード例 #2
0
        static void Main(string[] args)
        {
            var callback = new InstanceContext(new ClientCallback());
            var client   = new DuplexServiceClient(callback);

            client.Open();
            client.Register();
            Console.WriteLine("Press a key to exit");
            Console.ReadKey();
            client.Close();
        }
コード例 #3
0
        public async void Unsubscribe()
        {
            try
            {
                if (serverModel.State == CommunicationState.Opened)
                {
                    await serverModel.UnsubscribeAsync(clientID);

                    serverModel.Close();
                }
            }
            catch (Exception)
            {
                serverModel.Abort();
            }
        }
コード例 #4
0
 public void Dispose()
 {
     client.Close();
 }