From ebc2a8ef21bd90e753cf9b88ea186b0c87775de3 Mon Sep 17 00:00:00 2001 From: fcolin Date: Fri, 12 Mar 2010 16:40:27 +0000 Subject: mise en conformité des messages ping /pong start regexpid a 0 catch plantage NULL ref Correction pb a la fermeture d'ivy --- Ivy/IvyTCPStreamV4.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'Ivy/IvyTCPStreamV4.cs') diff --git a/Ivy/IvyTCPStreamV4.cs b/Ivy/IvyTCPStreamV4.cs index 65e325c..20526c7 100644 --- a/Ivy/IvyTCPStreamV4.cs +++ b/Ivy/IvyTCPStreamV4.cs @@ -45,11 +45,12 @@ namespace IvyBus this.output = new BinaryWriter(this, Ivy.ivyEncoding); this.receiver = _receiver; } - - internal void Close() + + void IvyProtocol.Close() { - this.input.Close(); this.output.Close(); + this.input.Close(); + this.Socket.Shutdown(SocketShutdown.Both); base.Close(); } @@ -124,13 +125,13 @@ namespace IvyBus { sendMsg(MessageType.DirectMsg, id, message); } - void IvyProtocol.TokenPong(string s) + void IvyProtocol.TokenPong(int id, string s) { - sendMsg(MessageType.Pong, 0, s); + sendMsg(MessageType.Pong, id, s); } - void IvyProtocol.TokenPing(string s) + void IvyProtocol.TokenPing(int id, string s) { - sendMsg(MessageType.Ping, 0, s); + sendMsg(MessageType.Ping, id, s); } void IvyProtocol.TokenBye(int id, string message) @@ -233,11 +234,11 @@ namespace IvyBus break; case MessageType.Pong: - receiver.TokenPong(msgData[0]); + receiver.TokenPong( msgId, msgData[0]); break; case MessageType.Ping: - receiver.TokenPing(msgData[0]); + receiver.TokenPing( msgId, msgData[0]); break; case MessageType.Error: -- cgit v1.1