From 656acde164183471faf6794a830d199bff490349 Mon Sep 17 00:00:00 2001 From: fcolin Date: Thu, 1 Feb 2007 09:47:03 +0000 Subject: Utilisateur : Fcolin Date : 6/02/06 Heure : 17:12 Archivé dans $/CSharp/Ivy/Ivy Commentaire: utilisation generale de traceDEbug et System.Diagnostics (vss 34) --- CSharp/Ivy/Ivy/IvyClient.cs | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'CSharp/Ivy') 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; /// A Class for the the peers on the bus. /// @@ -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; -- cgit v1.1