System.Net.HttpWebResponse.Close Method

Closes the response stream.

Syntax

public override void Close ()

Remarks

The HttpWebResponse.Close method closes the response stream and releases the connection to the resource for reuse by other requests.

You must call either the System.IO.Stream.Close or the HttpWebResponse.Close method to close the stream and release the connection for reuse. It is not necessary to call both System.IO.Stream.Close and HttpWebResponse.Close, but doing so does not cause an error. Failure to close the stream can cause your application to run out of connections.

Note:

This member outputs trace information when you enable network tracing in your application. For more information, see [<topic://conUsingNetworkTracing>].

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0