Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }