summaryrefslogtreecommitdiff
path: root/CSharp
diff options
context:
space:
mode:
authorfcolin2007-02-01 09:55:48 +0000
committerfcolin2007-02-01 09:55:48 +0000
commit72837d02119a06f7ce5250c8bf0c0d66408f4d7a (patch)
tree342e81986eaf2e2e06fe94047a046354590c9cf7 /CSharp
parent3a693fd2a671dd59ae50dbac565eab92ba15988d (diff)
downloadivy-csharp-72837d02119a06f7ce5250c8bf0c0d66408f4d7a.zip
ivy-csharp-72837d02119a06f7ce5250c8bf0c0d66408f4d7a.tar.gz
ivy-csharp-72837d02119a06f7ce5250c8bf0c0d66408f4d7a.tar.bz2
ivy-csharp-72837d02119a06f7ce5250c8bf0c0d66408f4d7a.tar.xz
Utilisateur : Fcolin Date : 9/02/06 Heure : 17:35 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 56)
Diffstat (limited to 'CSharp')
-rw-r--r--CSharp/Ivy/IvyPPC/Ivy.cs12
1 files changed, 7 insertions, 5 deletions
diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs
index ee55369..3a7a20d 100644
--- a/CSharp/Ivy/IvyPPC/Ivy.cs
+++ b/CSharp/Ivy/IvyPPC/Ivy.cs
@@ -326,7 +326,7 @@ namespace IvyBus
internal Dictionary<int, ApplicationBinding> bindings;
private List<IvyClient> clients;
private string[] sent_messageClasses = null;
- private bool stopped = false;
+ private bool stopped = true;
internal ushort applicationPort; /* Application port number */
internal IPAddress applicationHost; /* Application host number */
internal string applicationUniqueId; /* identifier Application unique timestamp-ipaddress-port */
@@ -534,10 +534,10 @@ namespace IvyBus
/// </summary>
public void stop()
{
- lock (this)
+ if (stopped)
+ return;
+ lock (app)
{
- if (stopped)
- return;
stopped = true;
traceDebug("beginning stopping the bus");
try
@@ -546,7 +546,9 @@ namespace IvyBus
if (serverThread != null)
{
app.Stop();
- serverThread.Join();
+ // Wait for Thread to end.
+ bool term = serverThread.Join(10000);
+ if (!term && (serverThread != null)) serverThread.Abort();
serverThread = null;
}
// The serverThread might be stopped even before having been created