コード例 #1
0
ファイル: _IpcEventChannel.cs プロジェクト: git-thinh/AppCore
        /// <summary> Stops listening to incoming events on the channel </summary>
        public void StopListening(int timeout)
        {
            IpcEventListener kill;

            lock (_sync)
            {
                kill      = _listener;
                _listener = null;
            }
            if (kill != null)
            {
                kill.StopListening(timeout);
                kill.Dispose();
            }
        }
コード例 #2
0
ファイル: _IpcEventChannel.cs プロジェクト: git-thinh/AppCore
        //static ConcurrentBag<string> _instanceNames = new ConcurrentBag<string>() { };


        /// <summary> Same as StartListening but specifies a name that can be used to lookup this instance </summary>
        public void StartListening(string instanceName)
        {
            if (_listener != null)
            {
                return;
            }

            lock (_sync)
            {
                try
                {
                    //[???????????????????????????????????????????????!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]
                    Check.Assert <InvalidOperationException>(_listener == null, "The channel is already listening.");
                    _listener = new IpcEventListener(this, _instanceId, instanceName);
                }
                catch (Exception ex) {
                    string m = ex.Message;
                }
            }
        }