summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CSharp/Ivy/IvyPPC/IvyWatcher.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyWatcher.cs b/CSharp/Ivy/IvyPPC/IvyWatcher.cs
index d14b67b..dc8343f 100644
--- a/CSharp/Ivy/IvyPPC/IvyWatcher.cs
+++ b/CSharp/Ivy/IvyPPC/IvyWatcher.cs
@@ -48,6 +48,7 @@ namespace IvyBus
this.domainaddr = domainaddr;
this.port = port;
listenThread = new Thread(new ThreadStart(this.Run));
+ listenThread.Name = "Ivy UDP Listener Thread";
// create the MulticastSocket
try
{
@@ -125,12 +126,6 @@ namespace IvyBus
Console.Error.WriteLine("can't connect to " + remotehost + " port " + port + " \n"+ e.Message);
}
}
- catch (ThreadInterruptedException te)
- {
- Console.Error.WriteLine( te.Message );
- Console.Error.WriteLine( te.StackTrace);
- running = false;
- }
catch (IOException jii)
{
running = false;
@@ -155,12 +150,11 @@ namespace IvyBus
lock(this)
{
traceDebug("begining stopping an IvyWatcher");
- Thread t = listenThread;
- listenThread = null;
broadcast.Close();
- if (t != null)
+ if (listenThread != null)
{
- t.Interrupt();
+ listenThread.Join();
+ listenThread = null;
}
// it might not even have been created
traceDebug("ending stopping an IvyWatcher");