diff options
-rw-r--r-- | CSharp/Ivy/IvyPPC/IvyWatcher.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyWatcher.cs b/CSharp/Ivy/IvyPPC/IvyWatcher.cs index 305e749..1815a04 100644 --- a/CSharp/Ivy/IvyPPC/IvyWatcher.cs +++ b/CSharp/Ivy/IvyPPC/IvyWatcher.cs @@ -97,12 +97,13 @@ namespace IvyBus IPAddress remotehost = remoteEP.Address;
traceDebug("BUSWATCHER Receive Broadcast from " + Dns.GetHostName() + ":" + remoteEP.Port);
// TODO if ( !isInDomain( remotehost ) ) continue;
- String[] st = msg.Split(' ');
- if (st.Length != 2)
+ String[] st = msg.Split(new char[]{' ','\n'},3);
+ if (st.Length != 3)
{
Console.Error.WriteLine("Bad format " + msg);
continue;
}
+
int version = Int32.Parse(st[0]);
port = Int32.Parse(st[1]);
if (version != Ivy.PROCOCOLVERSION)
|