summaryrefslogtreecommitdiff
path: root/Ivy/IvyTCPStreamV3.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ivy/IvyTCPStreamV3.cs')
-rw-r--r--Ivy/IvyTCPStreamV3.cs21
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;