Example #1
0
 /// <summary> Same as StartListening but specifies a name that can be used to lookup this instance </summary>
 public void StartListening(string instanceName)
 {
     lock (_sync)
     {
         Check.Assert <InvalidOperationException>(_listener == null, "The channel is already listening.");
         _listener = new IpcEventListener(this, _instanceId, instanceName);
     }
 }
Example #2
0
        /// <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();
            }
        }