Console.WriteLine (ex);
if (_state != STATE_STOPPED)
throw;
+#if !MONO_FEATURE_THREAD_ABORT
+ } catch (ThreadInterruptedException) {
+ break;
+#endif
#if MOBILE
} catch (InvalidOperationException ex) {
// This breaks some tests running on Android. The problem is that the stack trace
Console.WriteLine (ex);
#endif
} finally {
+#if MONO_FEATURE_THREAD_ABORT
Thread.Sleep (500);
+#else
+ try {
+ Thread.Sleep (500);
+ } catch (ThreadInterruptedException) {
+ // nothing to do
+ }
+#endif
if (listenSocket != null)
listenSocket.Close ();
}