From 41a6281db812aaedb06780c6da79346362360beb Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:54:42 +0000 Subject: Utilisateur : Fcolin Date : 5/02/04 Heure : 19:31 Archivé dans $/EScribe/Ivy Commentaire: (vss 23) --- CSharp/Ivy/IvyPPC/Ivy.cs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'CSharp/Ivy/IvyPPC/Ivy.cs') 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++) { -- cgit v1.1