From 8e53cdb6339b4589ed12ca27cf62a8d968aec921 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:43:34 +0000 Subject: Utilisateur : Fcolin Date : 7/02/06 Heure : 10:50 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 49) --- CSharp/Ivy/Ivy/Ivy.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'CSharp/Ivy') diff --git a/CSharp/Ivy/Ivy/Ivy.cs b/CSharp/Ivy/Ivy/Ivy.cs index b40b335..9ab06d7 100644 --- a/CSharp/Ivy/Ivy/Ivy.cs +++ b/CSharp/Ivy/Ivy/Ivy.cs @@ -397,19 +397,25 @@ namespace IvyBus /// public void start(string domainbus) { + int ndx = 0; + IPAddress localaddr; domainbus = getDomain(domainbus); try { //TODO remove ALL reverse DNS search !!!! - IPAddress localaddr = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0]; + //TODO possible bug applicationhost = 127.0.0.1 and not IP + do + { + localaddr = Dns.GetHostEntry(Dns.GetHostName()).AddressList[ndx++]; + } while (IPAddress.IsLoopback(localaddr)); app = new MyTcpListener(IPAddress.Any, 0); - app.Start(); applicationPort = (ushort)((IPEndPoint) app.LocalEndpoint).Port; applicationHost = localaddr; applicationUniqueId = string.Format("{0}-{1}-{2}", DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond, localaddr.ToString().Replace(".",""), applicationPort ); + app.Start(); } catch (IOException e) { @@ -885,6 +891,7 @@ namespace IvyBus * there might still be a lingering bug here, that we could avoid with the * SchizoToken. */ + //TODO bug multiple instance Reco car en 127.0.0.1 internal bool checkConnected(IvyClient clnt) { if (clnt.AppPort == 0) -- cgit v1.1