Close Method (Int32)

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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

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

Syntax

'Declaration
Public Sub Close ( _
    timeout As Integer _
)
public void Close(
    int timeout
)
public:
void Close(
    int timeout
)
member Close : 
        timeout:int -> unit 
public function Close(
    timeout : int
)

Parameters

  • timeout
    Type: System. . :: . .Int32
    A 32-bit signed integer that specifies the number of milliseconds to wait to send any remaining data before closing.

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.

.NET Framework Security

See Also

Reference

NetworkStream Class

Close Overload

System.Net.Sockets Namespace