From ce08b27551323c7a3d3572399ea6e1f79e651c96 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:54:52 +0000 Subject: Utilisateur : Fcolin Date : 30/11/05 Heure : 10:27 Archivé dans $/CSharp/Ivy Commentaire: (vss 28) --- CSharp/Ivy/IvyPPC/Ivy.cs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'CSharp/Ivy') diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs index 0790854..8ca2736 100644 --- a/CSharp/Ivy/IvyPPC/Ivy.cs +++ b/CSharp/Ivy/IvyPPC/Ivy.cs @@ -15,6 +15,7 @@ namespace IvyBus using System.Windows.Forms; using System.Globalization; using System.Text.RegularExpressions; + using System.Text; /// The Main bus Class /// @@ -76,15 +77,18 @@ namespace IvyBus { get { - string s = appName + " clients are: "; + StringBuilder s = new StringBuilder(); + s.Append(appName); + s.Append( " clients are: " ); lock( clients.SyncRoot ) { foreach (IvyClient client in clients ) { - s += client.ApplicationName + " "; + s.Append(client.ApplicationName); + s.Append( " " ); } } - return s; + return s.ToString(); } } @@ -153,8 +157,6 @@ namespace IvyBus /// the name of the application on the bus internal string appName; - /// the protocol version number - internal const int PROCOCOLVERSION = 4; /// the port for the UDP rendez vous, if none is supplied internal const int DEFAULT_PORT = 2010; // client default priority @@ -266,7 +268,7 @@ namespace IvyBus { throw new IvyException("can't open TCP service socket " + e); } - traceDebug("lib: " + libVersion + " protocol: " + PROCOCOLVERSION + " TCP service open on port " + applicationPort); + traceDebug("lib: " + libVersion + " protocol: " + IvyUDPStream.PROCOCOLVERSION + " TCP service open on port " + applicationPort); watchers = new ArrayList(); Domain[] d = parseDomains(domainbus); @@ -302,13 +304,16 @@ namespace IvyBus public string domains(string toparse) { - string s = "broadcasting on "; + StringBuilder s = new StringBuilder("broadcasting on "); Ivy.Domain[] d = parseDomains(toparse); for (int index = 0; index < d.Length; index++) { - s += d[index].Domainaddr + ":" + d[index].Port + " "; + s.Append(d[index].Domainaddr); + s.Append(":"); + s.Append(d[index].Port); + s.Append( " " ); } - return s; + return s.ToString(); } internal Domain[] parseDomains(string domainbus) @@ -766,7 +771,7 @@ namespace IvyBus { traceDebug("Error IvyServer exception: " + e.Message); - Console.Out.WriteLine("Ivy server socket reader caught an exception " + e.Message); + Console.Error.WriteLine("Ivy server socket reader caught an exception " + e.Message); // e.printStackTrace(); } catch (SocketException e) -- cgit v1.1