System.Net.Sockets.NetworkStream.Close Method

Closes the System.Net.Sockets.NetworkStream.

Syntax

public override void Close ()

Remarks

The NetworkStream.Close method frees both unmanaged and managed resources associated with the System.Net.Sockets.NetworkStream. If the System.Net.Sockets.NetworkStream owns the underlying System.Net.Sockets.Socket, it is closed as well.

If a System.Net.Sockets.NetworkStream was associated with a System.Net.Sockets.TcpClient, the NetworkStream.Close method will close the TCP connection, but not dispose of the associated System.Net.Sockets.TcpClient.

Requirements

Namespace: System.Net.Sockets
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0