summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfcolin2007-02-01 10:03:52 +0000
committerfcolin2007-02-01 10:03:52 +0000
commit99607f0dde8ce8a8dea58601d92d142a81cecec4 (patch)
treea0fd4c174255e545db49a7e01e10c9b9ae6e9a3e
parent55aa8d6be7423d9d496d9eacfc0ad47215a300ce (diff)
downloadivy-csharp-99607f0dde8ce8a8dea58601d92d142a81cecec4.zip
ivy-csharp-99607f0dde8ce8a8dea58601d92d142a81cecec4.tar.gz
ivy-csharp-99607f0dde8ce8a8dea58601d92d142a81cecec4.tar.bz2
ivy-csharp-99607f0dde8ce8a8dea58601d92d142a81cecec4.tar.xz
Utilisateur : Fcolin Date : 10/04/06 Heure : 18:45 Archivé dans $/CSharp/Ivy/Ivy Commentaire: optimisation diverse suite a passage de Code Analysis (vss 24)
-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