Java.Net.Socket.Connect Method
Connects this socket to the given remote host address and port specified by the SocketAddress remoteAddr with the specified timeout.

Syntax

[Android.Runtime.Register("connect", "(Ljava/net/SocketAddress;I)V", "GetConnect_Ljava_net_SocketAddress_IHandler")]
public virtual void Connect (SocketAddress remoteAddr, int timeout)

Parameters

remoteAddr
the address and port of the remote host to connect to.
timeout
the timeout value in milliseconds or 0 for an infinite timeout.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionif the given SocketAddress is invalid or not supported or the timeout value is negative.
Java.IO.IOExceptionif the socket is already connected or an error occurs while connecting.

Remarks

Connects this socket to the given remote host address and port specified by the SocketAddress remoteAddr with the specified timeout. The connecting method will block until the connection is established or an error occurred.

[Android Documentation]

Requirements

Namespace: Java.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1