From cb6b912700e659c58cc342c5c15ebfb8bd756169 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:51:41 +0000 Subject: Utilisateur : Fcolin Date : 12/01/06 Heure : 12:53 Archivé dans $/CSharp/Ivy/Ivy Commentaire: (vss 13) --- CSharp/Ivy/Ivy/IvyWatcher.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CSharp/Ivy/Ivy/IvyWatcher.cs b/CSharp/Ivy/Ivy/IvyWatcher.cs index d5141f3..28d7b7b 100644 --- a/CSharp/Ivy/Ivy/IvyWatcher.cs +++ b/CSharp/Ivy/Ivy/IvyWatcher.cs @@ -66,7 +66,7 @@ namespace IvyBus broadcast.SetSocketOption(SocketOptionLevel.Udp, SocketOptionName.AddMembership, new MulticastOption( group )); } // TODO support the Two protocol - if (Properties.Settings.Default.IvyProtocolVersion == 4) + if (bus.protocolVersion == 4) stream = new IvyUDPStreamV4(broadcast); else stream = new IvyUDPStreamV3(broadcast); @@ -99,13 +99,13 @@ namespace IvyBus stream.receiveMsg(out remoteEP, out version,out port,out appId,out appName); IPAddress remotehost = remoteEP.Address; - traceDebug("BUSWATCHER Receive Broadcast from " + Dns.GetHostByAddress(remotehost).HostName+ ":" + remoteEP.Port); + traceDebug("BUSWATCHER Receive Broadcast from " + Dns.GetHostEntry(remotehost).HostName + ":" + remoteEP.Port); //TODO if ( !isInDomain( remotehost ) ) continue; if (version != stream.ProtocolVersion) { - Console.WriteLine("Ignoring bad protocol version {0} expected {1}", version, stream.ProtocolVersion); + Console.Error.WriteLine("Ignoring bad protocol version {0} expected {1}", version, stream.ProtocolVersion); continue; } @@ -115,7 +115,7 @@ namespace IvyBus if ( (port == bus.applicationPort) && (remotehost.Equals(bus.applicationHost)) ) continue; - traceDebug("BUSWATCHER Broadcast de " + Dns.GetHostByAddress(remotehost).HostName + ":" + remoteEP.Port + " port " + port + + traceDebug("BUSWATCHER Broadcast de " + Dns.GetHostEntry(remotehost).HostName + ":" + remoteEP.Port + " port " + port + " version " + version + " id " + appId + " name " + appName); @@ -128,12 +128,12 @@ namespace IvyBus } catch (Exception e) { - Console.Error.WriteLine("can't connect to " + remotehost + " port " + port + " \n"+ e.Message); + Console.Error.WriteLine("can't connect to " + remotehost + " port " + port + " \n" + e.Message); } } catch (IOException jii) { - Console.Error.WriteLine("UDP listener " + jii.Message); + Console.Error.WriteLine("UDP listener " + jii.Message); running = false; } // catch (SocketException se) @@ -197,7 +197,7 @@ namespace IvyBus } catch (ArgumentException e) { - Console.Out.WriteLine("Bad broascat addr " + net); + Console.Error.WriteLine("Bad broascat addr " + net + "error " + e.Message); return null; } // out.println("net: "+net); @@ -208,7 +208,7 @@ namespace IvyBus { int sep_index = net.LastIndexOf(":"); int port = (sep_index == - 1)?Ivy.DEFAULT_PORT:Int32.Parse(net.Substring(sep_index + 1)); - // Console.Writeline("net: ["+net+"]\nsep_index: "+sep_index+"\nport: "+port); + // Console.Error.Writeline("net: ["+net+"]\nsep_index: "+sep_index+"\nport: "+port); return port; } @@ -216,7 +216,7 @@ namespace IvyBus private void traceDebug(String s) { if (bus.Debug) - Console.Out.WriteLine("-->ivywatcher<-- " + s); + Console.Error.WriteLine("-->ivywatcher<-- " + s); } } // class IvyWatcher -- cgit v1.1