Inheritance: IChannelMonitor, IDisposable
 protected override void OnStart()
 {
     base.OnStart();
     if (enabled)
     {
         monitor = new PortMapperMonitor(Application.PeerCast);
         Application.PeerCast.AddChannelMonitor(monitor);
     }
     Task.Run(async() => {
         if (enabled)
         {
             await DiscoverAsync().ConfigureAwait(false);
         }
         var results = await CheckPortAsync().ConfigureAwait(false);
         foreach (var result in results)
         {
             if (!result.Success)
             {
                 continue;
             }
             if (result.IsOpen)
             {
                 Application.PeerCast.SetPortStatus(result.LocalAddress, result.GlobalAddress, PortStatus.Open);
             }
             else
             {
                 Application.PeerCast.SetPortStatus(result.LocalAddress, result.GlobalAddress, PortStatus.Firewalled);
             }
         }
     });
 }
Example #2
0
 protected override void OnStart()
 {
     base.OnStart();
     if (!enabled) return;
     monitor = new PortMapperMonitor(Application.PeerCast);
     Application.PeerCast.AddChannelMonitor(monitor);
 }
Example #3
0
 protected override void OnStop()
 {
     if (monitor!=null) {
         Application.PeerCast.RemoveChannelMonitor(monitor);
         monitor.Dispose();
         monitor = null;
     }
     base.OnStop();
 }
 protected override void OnStop()
 {
     if (monitor != null)
     {
         Application.PeerCast.RemoveChannelMonitor(monitor);
         monitor.Dispose();
         monitor = null;
     }
     base.OnStop();
 }
Example #5
0
 protected override void OnStart()
 {
     base.OnStart();
     if (!enabled)
     {
         return;
     }
     monitor = new PortMapperMonitor(Application.PeerCast);
     Application.PeerCast.AddChannelMonitor(monitor);
 }