diff options
author | fcolin | 2010-03-12 16:40:27 +0000 |
---|---|---|
committer | fcolin | 2010-03-12 16:40:27 +0000 |
commit | ebc2a8ef21bd90e753cf9b88ea186b0c87775de3 (patch) | |
tree | a872054e01243a0cb1a000f36f8a1e64e1f87914 /Ivy/IvyTCPStreamV3.cs | |
parent | ddccd3d8f4fd59fb19fa6262460bbc5e2e67eac7 (diff) | |
download | ivy-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/IvyTCPStreamV3.cs')
-rw-r--r-- | Ivy/IvyTCPStreamV3.cs | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/Ivy/IvyTCPStreamV3.cs b/Ivy/IvyTCPStreamV3.cs index e261f5e..6c23726 100644 --- a/Ivy/IvyTCPStreamV3.cs +++ b/Ivy/IvyTCPStreamV3.cs @@ -31,10 +31,11 @@ namespace IvyBus this.input = new StreamReader(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();
}
@@ -110,14 +111,14 @@ namespace IvyBus this.SendMsg(MessageType.DirectMsg, id, message);
}
- void IvyProtocol.TokenPong(string s)
+ void IvyProtocol.TokenPong(int id, string s)
{
- this.SendMsg(MessageType.Pong, 0, s);
+ this.SendMsg(MessageType.Pong, id, s);
}
- void IvyProtocol.TokenPing(string s)
+ void IvyProtocol.TokenPing(int id, string s)
{
- this.SendMsg(MessageType.Ping, 0, s);
+ this.SendMsg(MessageType.Ping, id, s);
}
void IvyProtocol.TokenBye(int id, string message)
@@ -223,11 +224,11 @@ namespace IvyBus break;
case MessageType.Pong:
- this.receiver.TokenPong(msgData);
+ this.receiver.TokenPong(msgId,msgData);
break;
case MessageType.Ping:
- this.receiver.TokenPing(msgData);
+ this.receiver.TokenPing(msgId,msgData);
break;
case MessageType.Error:
@@ -249,6 +250,10 @@ namespace IvyBus }
+ catch (NullReferenceException)
+ {
+ return false;
+ }
catch (EndOfStreamException)
{
return false;
|