diff options
Diffstat (limited to 'CSharp/Ivy')
-rw-r--r-- | CSharp/Ivy/Ivy/IvyClient.cs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/CSharp/Ivy/Ivy/IvyClient.cs b/CSharp/Ivy/Ivy/IvyClient.cs index eabdfb1..3d541d0 100644 --- a/CSharp/Ivy/Ivy/IvyClient.cs +++ b/CSharp/Ivy/Ivy/IvyClient.cs @@ -228,6 +228,7 @@ namespace IvyBus stopListening();
// bus.clientDisconnect(this);
socket.Close(); // should I also close in and out ?
+ socket = null;
}
/// <summary> sends the substrings of a message to the peer for each matching regexp.
@@ -262,10 +263,12 @@ namespace IvyBus clientThread = null;
// Tell newThread to go to sleep.
running = false;
- t.Interrupt();
- // Wait for newThread to end.
- t.Join();
-
+ if ( Thread.CurrentThread != t )
+ {
+ t.Interrupt();
+ // Wait for newThread to end.
+ t.Join();
+ }
}
/// <summary> compares two peers the id is the couple (host,service port).
|