summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CSharp/Ivy/Ivy/Ivy.cs25
1 files changed, 15 insertions, 10 deletions
diff --git a/CSharp/Ivy/Ivy/Ivy.cs b/CSharp/Ivy/Ivy/Ivy.cs
index 0790854..8ca2736 100644
--- a/CSharp/Ivy/Ivy/Ivy.cs
+++ b/CSharp/Ivy/Ivy/Ivy.cs
@@ -15,6 +15,7 @@ namespace IvyBus
using System.Windows.Forms;
using System.Globalization;
using System.Text.RegularExpressions;
+ using System.Text;
/// <summary> The Main bus Class
/// </summary>
@@ -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)