diff options
author | fcolin | 2007-02-01 09:47:03 +0000 |
---|---|---|
committer | fcolin | 2007-02-01 09:47:03 +0000 |
commit | 656acde164183471faf6794a830d199bff490349 (patch) | |
tree | 32be7b572aebe70f30ab2ede0db7a1571fec8d4c /CSharp | |
parent | 1c7cfd31fa78acabe068a8eefef011c3df4db953 (diff) | |
download | ivy-csharp-656acde164183471faf6794a830d199bff490349.zip ivy-csharp-656acde164183471faf6794a830d199bff490349.tar.gz ivy-csharp-656acde164183471faf6794a830d199bff490349.tar.bz2 ivy-csharp-656acde164183471faf6794a830d199bff490349.tar.xz |
Utilisateur : Fcolin Date : 6/02/06 Heure : 17:12 Archivé dans $/CSharp/Ivy/Ivy Commentaire: utilisation generale de traceDEbug et System.Diagnostics (vss 34)
Diffstat (limited to 'CSharp')
-rw-r--r-- | CSharp/Ivy/Ivy/IvyClient.cs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/CSharp/Ivy/Ivy/IvyClient.cs b/CSharp/Ivy/Ivy/IvyClient.cs index fe70620..9b3c2f6 100644 --- a/CSharp/Ivy/Ivy/IvyClient.cs +++ b/CSharp/Ivy/Ivy/IvyClient.cs @@ -15,6 +15,7 @@ namespace IvyBus using System.Net;
using System.Net.Sockets;
using System.Configuration;
+ using System.Diagnostics;
/// <summary> A Class for the the peers on the bus.
/// </summary>
@@ -310,20 +311,19 @@ namespace IvyBus }
catch ( ObjectDisposedException e )
{
- traceDebug( "ivyclient socket closed "+e.Message );
+ traceDebug( "socket closed "+e.Message );
running = false;
break;
}
catch (IvyException ie)
{
- Console.Error.WriteLine(ie.Message);
- Console.Error.WriteLine(ie.StackTrace);
- running = false;
+ traceDebug("socket closed IvyException" + ie.Message);
+ running = false;
break;
}
catch (SocketException se)
{
- traceDebug( "ivyclient socket closed "+se.Message );
+ traceDebug( "socket closed "+se.Message );
running = false;
break;
}
@@ -331,14 +331,12 @@ namespace IvyBus {
if ( e.InnerException is SocketException )
{
- traceDebug( "ivyclient socket closed" );
+ traceDebug( "socket closed" );
}
else
{
traceDebug("abnormally Disconnected from " + RemoteAddress + ":" + RemotePort);
- Console.Error.WriteLine(e.Message);
- Console.Error.WriteLine(e.StackTrace);
}
running = false;
break;
@@ -430,7 +428,7 @@ namespace IvyBus }
catch (KeyNotFoundException ex)
{
- Console.Error.WriteLine("DelBinding " + ex.Message);
+ traceDebug("DelBinding " + ex.Message);
}
}
}
@@ -501,11 +499,11 @@ namespace IvyBus {
return "IvyClient " + bus.appName + ":" + appName;
}
-
+
+ [Conditional("DEBUG")]
private void traceDebug(String s)
{
- if (bus.VerboseDebug)
- Console.Error.WriteLine("-->IvyClient " + bus.appName + ":" + appName + "<-- " + s);
+ Trace.WriteLineIf(Ivy.VerboseDebug, "-->IvyClient " + bus.appName + ":" + appName + "<-- " + s);
}
internal bool isPinging = false;
|