private void Exit() { try { _param.LocalSource.Close(); _channel.Close(); } finally { _completeEvent.Set(); //We must not skip this Set() -- or a deadlock may happen! } }