Export (0) Print
Expand All

TcpClient.Finalize Method

Frees resources used by the TcpClient class.

[C#] In C#, finalizers are expressed using destructor syntax.

[C++] In C++, finalizers are expressed using destructor syntax.

[Visual Basic]
Overrides Protected Sub Finalize()
[C#]
~TcpClient();
[C++]
~TcpClient();
[JScript]
protected override function Finalize();

Remarks

This method overrides Object.Finalize. Application code should not call this method; an object's Finalize method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the GC.SuppressFinalize method.

The TcpClient class finalizer closes the TCP connection and releases all managed resources associated with the TcpClient. These resources include the underlying Socket used for connecting with the remote host, and the NetworkStream used to send and receive data. The finalizer does not release any unmanaged resources.

For more information, see Finalize Methods and Destructors, Cleaning Up Unmanaged Resources, and Overriding the Finalize Method.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

TcpClient Class | TcpClient Members | System.Net.Sockets Namespace | Close | Programming for Garbage Collection

Show:
© 2014 Microsoft