示例#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);
     }
 }
示例#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);
     }
 }