NetworkStream.Close NetworkStream.Close NetworkStream.Close NetworkStream.Close Method

Definition

Overloads

Close() Close() Close() Close()
Close(Int32) Close(Int32) Close(Int32) Close(Int32)

Closes the NetworkStream after waiting the specified time to allow data to be sent.

Close() Close() Close() Close()

public:
 override void Close();
public override void Close ();
override this.Close : unit -> unit
Public Overrides Sub Close ()

Close(Int32) Close(Int32) Close(Int32) Close(Int32)

Closes the NetworkStream after waiting the specified time to allow data to be sent.

public:
 void Close(int timeout);
public void Close (int timeout);
override this.Close : int -> unit
Public Sub Close (timeout As Integer)
Parameters
timeout
Int32 Int32 Int32 Int32

A 32-bit signed integer that specifies the number of milliseconds to wait to send any remaining data before closing.

Exceptions

Remarks

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

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

Applies to