nterry/Mono.Nat — pull request #3 by LukePulverenti (2014-05-24 00:24:14+00:00)
Title: Catch unhandled ObjectDisposedException

We are seeing this in our application:

https://github.com/MediaBrowser/MediaBrowser/blob/master/MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs

2014-05-23 16:06:15.7753 Error - Main: UnhandledException
Cannot access a disposed object.
Object name: 'System.Net.Sockets.UdpClient'.
System.ObjectDisposedException
at System.Net.Sockets.UdpClient.Receive(IPEndPoint& remoteEP)
at Mono.Nat.Pmp.PmpNatDevice.CreatePortMapListen(Object obj)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()