diff options
author | fcolin | 2007-02-01 09:52:03 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 09:52:03 +0000 |
commit | b477cfdf56e02df45372338ee80d155e69b86d08 (patch) | |
tree | 2a14aad82c002f303c75660b310de5a9752e5bb0 /CSharp | |
parent | 0b3332e904174414c5775dd545e78b691ab92ee1 (diff) | |
download | ivy-csharp-b477cfdf56e02df45372338ee80d155e69b86d08.zip ivy-csharp-b477cfdf56e02df45372338ee80d155e69b86d08.tar.gz ivy-csharp-b477cfdf56e02df45372338ee80d155e69b86d08.tar.bz2 ivy-csharp-b477cfdf56e02df45372338ee80d155e69b86d08.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)
Diffstat (limited to 'CSharp')
-rw-r--r-- | CSharp/Ivy/Ivy/IvyWatcher.cs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/CSharp/Ivy/Ivy/IvyWatcher.cs b/CSharp/Ivy/Ivy/IvyWatcher.cs index b164260..0c56d07 100644 --- a/CSharp/Ivy/Ivy/IvyWatcher.cs +++ b/CSharp/Ivy/Ivy/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
|