internal void StopWCFHosting() { try { if (_HostRunner != null) { _HostRunner.StopHosting(); _HostRunner.PNDataReceived -= _HostRunner_PNDataReceived; _HostRunner.PNDataError -= _HostRunner_PNDataError; _HostRunner = null; } } catch (Exception ex) { PNStatic.LogException(ex); } }
internal void StartWCFHosting() { try { _HostRunner = new PNWCFHostRunner(); _HostRunner.PNDataReceived += _HostRunner_PNDataReceived; _HostRunner.PNDataError += _HostRunner_PNDataError; Task.Factory.StartNew( () => _HostRunner.StartHosting( PNStatic.Settings.Network.ExchangePort.ToString(CultureInfo.InvariantCulture))); //var t = new Thread(() => _HostRunner.StartHosting(PNStatic.Settings.Network.ExchangePort.ToString(CultureInfo.InvariantCulture))); //t.Start(); } catch (Exception ex) { PNStatic.LogException(ex); } }