Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Active Property

TcpClient.Active Property

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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft