summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfcolin2007-02-01 09:42:43 +0000
committerfcolin2007-02-01 09:42:43 +0000
commit7bd9614971dc7c711d805ed8d3341a50d1760283 (patch)
tree930dbd308ca145f9f937389b7d91c61de9b6b29e
parentb4a6a643179f544bee89841da791e5f7a856a6c0 (diff)
downloadivy-csharp-7bd9614971dc7c711d805ed8d3341a50d1760283.zip
ivy-csharp-7bd9614971dc7c711d805ed8d3341a50d1760283.tar.gz
ivy-csharp-7bd9614971dc7c711d805ed8d3341a50d1760283.tar.bz2
ivy-csharp-7bd9614971dc7c711d805ed8d3341a50d1760283.tar.xz
Utilisateur : Fcolin Date : 5/02/04 Heure : 19:31 Archivé dans $/EScribe/Ivy Commentaire: (vss 23)
-rw-r--r--CSharp/Ivy/Ivy/Ivy.cs19
1 files changed, 8 insertions, 11 deletions
diff --git a/CSharp/Ivy/Ivy/Ivy.cs b/CSharp/Ivy/Ivy/Ivy.cs
index ec4e401..7d648e0 100644
--- a/CSharp/Ivy/Ivy/Ivy.cs
+++ b/CSharp/Ivy/Ivy/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++)
{