Socket.IsConnected Property

Definition

Returns the connection state of the socket.

public virtual bool IsConnected { [Android.Runtime.Register("isConnected", "()Z", "GetIsConnectedHandler")] get; }
[<get: Android.Runtime.Register("isConnected", "()Z", "GetIsConnectedHandler")>]
member this.IsConnected : bool

Property Value

true if the socket was successfuly connected to a server

Attributes

Remarks

Returns the connection state of the socket.

Note: Closing a socket doesn't clear its connection state, which means this method will return true for a closed socket (see #isClosed()) if it was successfuly connected prior to being closed.

Added in 1.4.

Java documentation for java.net.Socket.isConnected().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to