TcpClient.Active Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or set a value that indicates whether a connection has been made.

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

protected bool Active { get; set; }

Property Value

Type: System.Boolean

true if the connection has been made; otherwise, false.

Classes deriving from TcpClient can use this property to determine if a connection attempt has succeeded. It does not monitor the ongoing connection state of TcpClient. If the remote host closes the connection, Active will not be updated. If you are deriving from TcpClient and require closer attention to the connection state, use the Connected property of the Socket returned by the Client method.

.NET Framework
Available since 1.1
Return to top
Show: