trim nat project

This commit is contained in:
Luke Pulverenti
2016-10-27 23:11:21 -04:00
parent 5dca85fe15
commit bdcaf5dd02
22 changed files with 151 additions and 1464 deletions

View File

@@ -91,9 +91,6 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
NatUtility.DeviceLost += NatUtility_DeviceLost;
// it is hard to say what one should do when an unhandled exception is raised
// because there isn't anything one can do about it. Probably save a log or ignored it.
NatUtility.UnhandledException += NatUtility_UnhandledException;
NatUtility.StartDiscovery();
_timer = new PeriodicTimer(ClearCreatedRules, null, TimeSpan.FromMinutes(5), TimeSpan.FromMinutes(5));
@@ -184,21 +181,6 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
}
}
void NatUtility_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
var ex = e.ExceptionObject as Exception;
if (ex == null)
{
//_logger.Error("Unidentified error reported by Mono.Nat");
}
else
{
// Seeing some blank exceptions coming through here
//_logger.ErrorException("Error reported by Mono.Nat: ", ex);
}
}
void NatUtility_DeviceFound(object sender, DeviceEventArgs e)
{
try
@@ -287,7 +269,6 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
NatUtility.StopDiscovery();
NatUtility.DeviceFound -= NatUtility_DeviceFound;
NatUtility.DeviceLost -= NatUtility_DeviceLost;
NatUtility.UnhandledException -= NatUtility_UnhandledException;
}
// Statements in try-block will no fail because StopDiscovery is a one-line
// method that was no chances to fail.