Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.