diff options
author | fcolin | 2007-02-01 09:56:00 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 09:56:00 +0000 |
commit | fc2323f276c1e45d7e854cfb4dbc73b276620470 (patch) | |
tree | 39ba175c340c9069ee5cb3f31a724a825bd3cb51 /CSharp/Ivy/IvyPPC/Ivy.cs | |
parent | ac06bbab4fa870ee334112778f2b3d60c7ac34dd (diff) | |
download | ivy-csharp-fc2323f276c1e45d7e854cfb4dbc73b276620470.zip ivy-csharp-fc2323f276c1e45d7e854cfb4dbc73b276620470.tar.gz ivy-csharp-fc2323f276c1e45d7e854cfb4dbc73b276620470.tar.bz2 ivy-csharp-fc2323f276c1e45d7e854cfb4dbc73b276620470.tar.xz |
Utilisateur : Fcolin Date : 10/04/06 Heure : 18:45 Archivé dans $/CSharp/Ivy/Ivy Commentaire: optimisation diverse suite a passage de Code Analysis (vss 62)
Diffstat (limited to 'CSharp/Ivy/IvyPPC/Ivy.cs')
-rw-r--r-- | CSharp/Ivy/IvyPPC/Ivy.cs | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/CSharp/Ivy/IvyPPC/Ivy.cs b/CSharp/Ivy/IvyPPC/Ivy.cs index 5b15275..1cffc1b 100644 --- a/CSharp/Ivy/IvyPPC/Ivy.cs +++ b/CSharp/Ivy/IvyPPC/Ivy.cs @@ -224,7 +224,7 @@ namespace IvyBus [Category("Ivy")]
#endif
[DefaultValue(null)]
- public string[] SentMessageClasses
+ public StringCollection SentMessageClasses
{
get
{
@@ -280,7 +280,6 @@ namespace IvyBus internal const ushort DEFAULT_PRIORITY = 100;
/// the domain for the UDP rendez vous
private static readonly string DEFAULT_DOMAIN = "127.255.255.255:" + DEFAULT_PORT;
- private const string libVersion = "2.0.0";
internal int protocolVersion = 3;
private static bool debug = false;
private static ushort serial = 0; /* an unique ID for each regexp */
@@ -300,7 +299,7 @@ namespace IvyBus internal Dictionary<int, ApplicationBinding> bindings;
private List<IvyClient> clients;
- private string[] sent_messageClasses = null;
+ private StringCollection sent_messageClasses;
private bool stopped = true;
internal ushort applicationPort; /* Application port number */
internal IPAddress applicationHost; /* Application host number */
@@ -445,7 +444,7 @@ namespace IvyBus {
throw new IvyException("can't open TCP service socket " + e);
}
- traceDebug("lib: " + libVersion + " protocol: " + ProtocolVersion + " TCP service open on port " + applicationPort);
+ traceDebug("Ivy protocol: " + ProtocolVersion + " TCP service open on port " + applicationPort);
watchers = new List<IvyWatcher>();
Domain[] d = parseDomains(domainbus);
@@ -487,7 +486,7 @@ namespace IvyBus }
/* a small private method for debbugging purposes */
- public string domains(string toparse)
+ public static string domains(string toparse)
{
StringBuilder s = new StringBuilder("broadcasting on ");
Ivy.Domain[] d = parseDomains(toparse);
@@ -501,7 +500,7 @@ namespace IvyBus return s.ToString();
}
- internal Domain[] parseDomains(string domainbus)
+ internal static Domain[] parseDomains(string domainbus)
{
string[] st = domainbus.Split(',');
Domain[] d = new Domain[st.Length];
@@ -654,7 +653,7 @@ namespace IvyBus {
throw new IvyException("client wants to remove an unexistant regexp " + id);
}
- ApplicationBinding bind = (ApplicationBinding)bindings[id];
+ //ApplicationBinding bind = (ApplicationBinding)bindings[id];
lock (clients)
{
foreach (IvyClient c in clients)
@@ -755,34 +754,34 @@ namespace IvyBus return true;
else return false;
}
- internal void FireDirectMessage(IvyClient app, int id, string arg)
+ internal void FireDirectMessage(IvyClient clnt, int id, string arg)
{
if (DirectMessageReceived != null)
{
if (IsSynchronous())
- syncControl.Invoke(DirectMessageReceived, new object[] { app, id, arg });
- else DirectMessageReceived(app, id, arg);
+ syncControl.Invoke(DirectMessageReceived, new object[] { clnt, id, arg });
+ else DirectMessageReceived(clnt, id, arg);
}
}
- internal void FireClientConnected(IvyClient app)
+ internal void FireClientConnected(IvyClient clnt)
{
if (ClientConnected != null)
{
if (IsSynchronous())
- syncControl.Invoke(ClientConnected, new object[] { app });
- else ClientConnected(app);
+ syncControl.Invoke(ClientConnected, new object[] { clnt });
+ else ClientConnected(clnt);
}
}
- internal void FireClientDisconnected(IvyClient app)
+ internal void FireClientDisconnected(IvyClient clnt)
{
if (ClientDisconnected != null)
{
try
{
if (IsSynchronous())
- syncControl.Invoke(ClientDisconnected, new object[] { app });
- else ClientDisconnected(app);
+ syncControl.Invoke(ClientDisconnected, new object[] { clnt });
+ else ClientDisconnected(clnt);
}
catch (ObjectDisposedException )
{
@@ -790,41 +789,41 @@ namespace IvyBus }
}
}
- internal void FireClientAddBinding(IvyClient app, string regexp)
+ internal void FireClientAddBinding(IvyClient clnt, string regexp)
{
if (BindingAdd != null)
{
if (IsSynchronous())
- syncControl.Invoke(BindingAdd, new object[] { app, regexp });
- else BindingAdd(app, regexp);
+ syncControl.Invoke(BindingAdd, new object[] { clnt, regexp });
+ else BindingAdd(clnt, regexp);
}
}
- internal void FireClientRemoveBinding(IvyClient app, string regexp)
+ internal void FireClientRemoveBinding(IvyClient clnt, string regexp)
{
if (BindingRemove != null)
{
if (IsSynchronous())
- syncControl.Invoke(BindingRemove, new object[] { app, regexp });
- else BindingRemove(app, regexp);
+ syncControl.Invoke(BindingRemove, new object[] { clnt, regexp });
+ else BindingRemove(clnt, regexp);
}
}
- internal ApplicationExit FireDie(IvyClient app, int id, string arg)
+ internal ApplicationExit FireDie(IvyClient clnt, int id, string arg)
{
if (dieReceived != null)
{
if (IsSynchronous())
- return (ApplicationExit)syncControl.Invoke(dieReceived, new object[] { app, id, arg });
- else return dieReceived(app, id, arg);
+ return (ApplicationExit)syncControl.Invoke(dieReceived, new object[] { clnt, id, arg });
+ else return dieReceived(clnt, id, arg);
}
return ApplicationExit.FORCE_EXIT;
}
- internal void FireError(IvyClient client, int id, string arg)
+ internal void FireError(IvyClient clnt, int id, string arg)
{
if (ErrorMessage != null)
{
if (IsSynchronous())
- syncControl.Invoke(ErrorMessage, new object[] { client, id, arg });
- else ErrorMessage(client, id, arg);
+ syncControl.Invoke(ErrorMessage, new object[] { clnt, id, arg });
+ else ErrorMessage(clnt, id, arg);
}
}
@@ -1014,7 +1013,7 @@ namespace IvyBus }
[Conditional("DEBUG")]
- private void traceDebug(string s)
+ private static void traceDebug(string s)
{
Trace.Assert(!debug, "-->ivy<-- " + s);
}
|