summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC/Ivy.cs
diff options
context:
space:
mode:
authorfcolin2007-02-01 09:54:42 +0000
committerfcolin2007-02-01 09:54:42 +0000
commit41a6281db812aaedb06780c6da79346362360beb (patch)
tree1c322f8574f5f95d4f1ea826ac9d78b795bc14da /CSharp/Ivy/IvyPPC/Ivy.cs
parentf1c66f1be911336e947ba2acf3c324a82b4038be (diff)
downloadivy-csharp-41a6281db812aaedb06780c6da79346362360beb.zip
ivy-csharp-41a6281db812aaedb06780c6da79346362360beb.tar.gz
ivy-csharp-41a6281db812aaedb06780c6da79346362360beb.tar.bz2
ivy-csharp-41a6281db812aaedb06780c6da79346362360beb.tar.xz
Utilisateur : Fcolin Date : 5/02/04 Heure : 19:31 Archivé dans $/EScribe/Ivy Commentaire: (vss 23)
Diffstat (limited to 'CSharp/Ivy/IvyPPC/Ivy.cs')
-rw-r--r--CSharp/Ivy/IvyPPC/Ivy.cs19
1 files changed, 8 insertions, 11 deletions
diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs
index ec4e401..7d648e0 100644
--- a/CSharp/Ivy/IvyPPC/Ivy.cs
+++ b/CSharp/Ivy/IvyPPC/Ivy.cs
@@ -109,18 +109,10 @@ namespace IvyBus
{
public MyTcpListener(IPAddress address, int port) : base(address, port)
{
- //Socket s = this.Server;
- // set Listen MaxConnections to 10 .
- //IPOptions lingerOption = new IPOptions (true, 10);
-
- //s.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.MaxConnections , 10 );
}
- public void WaitForActive()
+ public bool IsActive()
{
- while( ! this.Active )
- {
- Thread.Sleep( 50 );
- }
+ return this.Active;
}
@@ -235,7 +227,12 @@ namespace IvyBus
serverThread = new Thread(new ThreadStart(this.Run));
serverThread.Name = "Ivy Tcp Server Thread";
serverThread.Start();
- app.WaitForActive();
+ // Wait for readyness
+ while ( serverThread.ThreadState != ThreadState.Running || !app.IsActive())
+ {
+ Console.WriteLine( " Ivy Threading start in progress..." );
+ Thread.Sleep( 100 );
+ }
// sends the broadcasts and listen to incoming connexions
for (int i = 0; i < watchers.Count; i++)
{