summaryrefslogtreecommitdiff
path: root/CSharp/Ivy/IvyPPC
diff options
context:
space:
mode:
Diffstat (limited to 'CSharp/Ivy/IvyPPC')
-rw-r--r--CSharp/Ivy/IvyPPC/IvyWatcher.cs14
1 files changed, 6 insertions, 8 deletions
diff --git a/CSharp/Ivy/IvyPPC/IvyWatcher.cs b/CSharp/Ivy/IvyPPC/IvyWatcher.cs
index b164260..0c56d07 100644
--- a/CSharp/Ivy/IvyPPC/IvyWatcher.cs
+++ b/CSharp/Ivy/IvyPPC/IvyWatcher.cs
@@ -28,7 +28,6 @@ namespace IvyBus
internal class IvyWatcher
{
private Ivy bus; /* master bus controler */
- private String domainaddr;
private int port;
private volatile Thread listenThread;
private IPAddress group;
@@ -45,7 +44,6 @@ namespace IvyBus
internal IvyWatcher(Ivy bus, String domainaddr, int port)
{
this.bus = bus;
- this.domainaddr = domainaddr;
this.port = port;
listenThread = new Thread(new ThreadStart(this.Run));
listenThread.Name = "Ivy UDP Listener Thread";
@@ -91,12 +89,12 @@ namespace IvyBus
while (running)
{
ushort version;
- ushort port;
+ ushort appPort;
string appId;
string appName;
IPEndPoint remoteEP;
- stream.receiveMsg(out remoteEP, out version, out port, out appId, out appName);
+ stream.receiveMsg(out remoteEP, out version, out appPort, out appId, out appName);
IPAddress remotehost = remoteEP.Address;
traceDebug("BUSWATCHER Receive Broadcast from " + Dns.GetHostEntry(remotehost).HostName + ":" + remoteEP.Port);
@@ -111,22 +109,22 @@ namespace IvyBus
// filtrage des self Broadcast
if (appId == bus.AppId)
continue;
- if ((port == bus.applicationPort) && (remotehost.Equals(bus.applicationHost)))
+ if ((appPort == bus.applicationPort) && (remotehost.Equals(bus.applicationHost)))
continue;
- traceDebug("BUSWATCHER reponse au Broadcast de " + Dns.GetHostEntry(remotehost).HostName + ":" + remoteEP.Port + " port " + port +
+ traceDebug("BUSWATCHER reponse au Broadcast de " + Dns.GetHostEntry(remotehost).HostName + ":" + remoteEP.Port + " port " + appPort +
" version " + version +
" id " + appId +
" name " + appName);
try
{
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- IPEndPoint hostEndPoint = new IPEndPoint(remoteEP.Address, port);
+ IPEndPoint hostEndPoint = new IPEndPoint(remoteEP.Address, appPort);
socket.Connect(hostEndPoint);
bus.addClient(socket, appName);
}
catch (Exception e)
{
- traceDebug("can't connect to " + remotehost + " port " + port + " \n" + e.Message);
+ traceDebug("can't connect to " + remotehost + " port " + appPort + " \n" + e.Message);
}
} // while