diff options
author | fcolin | 2007-02-01 09:52:13 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 09:52:13 +0000 |
commit | 4f696bac9166ee199a45cfecc7ea8f41c45c2d00 (patch) | |
tree | 7c763387da601239dd559ba972ee6ba3a5ff4e16 /CSharp | |
parent | 389885380bfdf41ade46565f1a99df60ce52fba1 (diff) | |
download | ivy-csharp-4f696bac9166ee199a45cfecc7ea8f41c45c2d00.zip ivy-csharp-4f696bac9166ee199a45cfecc7ea8f41c45c2d00.tar.gz ivy-csharp-4f696bac9166ee199a45cfecc7ea8f41c45c2d00.tar.bz2 ivy-csharp-4f696bac9166ee199a45cfecc7ea8f41c45c2d00.tar.xz |
Utilisateur : Fcolin Date : 17/10/06 Heure : 18:36 Archivé dans $/CSharp/Ivy/Ivy Commentaire: modification debug et correction bug stream UDP pas reseté (vss 29)
Diffstat (limited to 'CSharp')
-rw-r--r-- | CSharp/Ivy/Ivy/IvyWatcher.cs | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/CSharp/Ivy/Ivy/IvyWatcher.cs b/CSharp/Ivy/Ivy/IvyWatcher.cs index 9a0fc5b..092de81 100644 --- a/CSharp/Ivy/Ivy/IvyWatcher.cs +++ b/CSharp/Ivy/Ivy/IvyWatcher.cs @@ -81,7 +81,7 @@ namespace IvyBus /// </summary>
public void Run()
{
- traceDebug("beginning of a watcher Thread");
+ Ivy.traceProtocol("IvyWatcher", "beginning of a watcher Thread");
try
{
@@ -97,13 +97,13 @@ namespace IvyBus 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);
+ Ivy.traceProtocol("IvyWatcher", "Receive Broadcast from " + Dns.GetHostEntry(remotehost).HostName + ":" + remoteEP.Port);
//TODO if ( !isInDomain( remotehost ) ) continue;
if (version != stream.ProtocolVersion)
{
- traceDebug("Ignoring bad protocol version " + version + " expected " + stream.ProtocolVersion);
+ Ivy.traceError("IvyWatcher","Ignoring bad protocol version " + version + " expected " + stream.ProtocolVersion);
continue;
}
@@ -113,7 +113,7 @@ namespace IvyBus if ((appPort == bus.applicationPort) && (remotehost.Equals(bus.applicationHost)))
continue;
- traceDebug("BUSWATCHER reponse au Broadcast de " + Dns.GetHostEntry(remotehost).HostName + ":" + remoteEP.Port + " port " + appPort +
+ Ivy.traceProtocol("IvyWatcher", "reponse au Broadcast de " + Dns.GetHostEntry(remotehost).HostName + ":" + remoteEP.Port + " port " + appPort +
" version " + version +
" id " + appId +
" name " + appName);
@@ -122,25 +122,26 @@ namespace IvyBus {
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint hostEndPoint = new IPEndPoint(remoteEP.Address, appPort);
+ socket.Blocking = true;
socket.Connect(hostEndPoint);
bus.addClient(socket, appName);
}
catch (Exception e)
{
- traceDebug("can't connect to " + remotehost + " port " + appPort + " \n" + e.Message);
+ Ivy.traceError("IvyWatcher","can't connect to " + remotehost + " port " + appPort + " \n" + e.Message);
}
} // while
}
catch (SocketException se)
{
- traceDebug("watcher socket closed: " + se.Message);
+ Ivy.traceError("IvyWatcher","watcher socket closed: " + se.Message);
}
catch (IOException ioe)
{
- traceDebug("watcher thread ended: " + ioe.Message);
+ Ivy.traceError("IvyWatcher","watcher thread ended: " + ioe.Message);
}
- traceDebug("end of a watcher thread");
+ Ivy.traceProtocol("IvyWatcher", "end of a watcher thread");
}
/// <summary> stops the thread waiting on the broadcast socket
@@ -149,7 +150,7 @@ namespace IvyBus {
lock (stream)
{
- traceDebug("begining stopping an IvyWatcher");
+ Ivy.traceProtocol("IvyWatcher", "begining stopping an IvyWatcher");
stream.Close();
if (listenThread != null)
{
@@ -159,7 +160,7 @@ namespace IvyBus listenThread = null;
}
// it might not even have been created
- traceDebug("ending stopping an IvyWatcher");
+ Ivy.traceProtocol("IvyWatcher", "ending stopping an IvyWatcher");
}
}
@@ -173,13 +174,6 @@ namespace IvyBus }
}
- [Conditional("DEBUG")]
- private static void traceDebug(string s)
- {
- Trace.Assert(!Ivy.VerboseDebug, "-->ivywatcher<-- " + s);
- }
}
- // class IvyWatcher
- /* EOF */
}
\ No newline at end of file |