summaryrefslogtreecommitdiff
path: root/Ivy/Ivy.cs
diff options
context:
space:
mode:
authorfcolin2010-03-12 16:40:27 +0000
committerfcolin2010-03-12 16:40:27 +0000
commitebc2a8ef21bd90e753cf9b88ea186b0c87775de3 (patch)
treea872054e01243a0cb1a000f36f8a1e64e1f87914 /Ivy/Ivy.cs
parentddccd3d8f4fd59fb19fa6262460bbc5e2e67eac7 (diff)
downloadivy-csharp-ebc2a8ef21bd90e753cf9b88ea186b0c87775de3.zip
ivy-csharp-ebc2a8ef21bd90e753cf9b88ea186b0c87775de3.tar.gz
ivy-csharp-ebc2a8ef21bd90e753cf9b88ea186b0c87775de3.tar.bz2
ivy-csharp-ebc2a8ef21bd90e753cf9b88ea186b0c87775de3.tar.xz
mise en conformité des messages ping /pong
start regexpid a 0 catch plantage NULL ref Correction pb a la fermeture d'ivy
Diffstat (limited to 'Ivy/Ivy.cs')
-rw-r--r--Ivy/Ivy.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/Ivy/Ivy.cs b/Ivy/Ivy.cs
index 1dfd967..922bb27 100644
--- a/Ivy/Ivy.cs
+++ b/Ivy/Ivy.cs
@@ -198,7 +198,7 @@ namespace IvyBus
private static readonly string DefaultDomain = "127.0.0.1:" + DefaultPort;
internal int protocolVersion = 3;
private static bool debugProtocol; // false by default runtime
- private static int serial; /* an unique ID for each regexp */ // 0 by default runtime
+ private static int serial = -1; /* an unique ID for each regexp */ // -1 to start numbering at 0
private MyTcpListener app;
private List<IvyWatcher> watchers;
private Thread serverThread; // to ensure quick communication of the end
@@ -887,9 +887,12 @@ namespace IvyBus
/// <returns></returns>
public int Ping(string target, string message)
{
+ int id = (int)DateTime.Now.Ticks;
ReadOnlyCollection<IvyClient> v = GetClientsByName(target);
foreach (IvyClient clnt in v)
- clnt.stream.TokenPing(message);
+ {
+ clnt.stream.TokenPing(id, message);
+ }
return v.Count;
}