SocketTools .NET Edition

FtpClient.Trace Property

Gets and sets a value which indicates if socket function tracing is enabled.

[Visual Basic]
Public Property Trace As Boolean
[C#]
public bool Trace {get; set;}

Property Value

Returns true if socket function tracing is enabled; otherwise returns false. The default value is false.

Remarks

The Trace property is used to enable (or disable) the tracing of Windows Sockets function calls. When enabled, each function call is logged to a file, including the function parameters, return value and error code if applicable. This facility can be enabled and disabled at run time, and the trace log file can be specified by setting the TraceFile property. All function calls that are being logged are appended to the trace file, if it exists. If no trace file exists when tracing is enabled, the trace file is created.

The tracing facility is available in all of the SocketTools networking classes and is enabled or disabled for an entire process. This means that once trace logging is enabled for a given component, all of the function calls made by the process using any of the SocketTools classes will be logged. For example, if you have an application using both the File Transfer Protocol and Post Office Protocol classes, and you set the Trace property to true, function calls made by both classes will be logged. Additionally, enabling a trace is cumulative, and tracing is not stopped until it is disabled for all classes used by the process.

If trace logging is not enabled, there is no negative impact on performance or throughput. Once enabled, application performance can degrade, especially in those situations in which multiple processes are being traced or the logfile is fairly large. Since logfiles can grow very quickly, even with modest applications, it is recommended that you delete the file when it is no longer needed.

When redistributing your application, make sure that you include the SocketTools7.TraceLog.dll module with your installation. If this library is not present, then no trace output will be generated and the value of the Trace property will be ignored. Only those function calls made by the SocketTools networking classes will be logged. Calls made directly to the Windows Sockets API, or calls made by other classes, will not be logged.

See Also

FtpClient Class | SocketTools Namespace