Javax.Net.SocketFactory.CreateSocket Method
Creates a new socket which is connected to the remote host specified by the parameters host and port.

Syntax

[Android.Runtime.Register("createSocket", "(Ljava/lang/String;ILjava/net/InetAddress;I)Ljava/net/Socket;", "GetCreateSocket_Ljava_lang_String_ILjava_net_InetAddress_IHandler")]
public abstract Java.Net.Socket CreateSocket (string host, int port, Java.Net.InetAddress localHost, int localPort)

Parameters

host
the remote host address the socket has to be connected to.
port
the port number of the remote host at which the socket is connected.
localHost
the local host address the socket is bound to.
localPort
the port number of the local host at which the socket is bound.

Returns

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Java.IO.IOExceptionif an error occurs while creating a new socket.
Java.Net.UnknownHostExceptionif the specified host is unknown or the IP address could not be resolved.

Remarks

Creates a new socket which is connected to the remote host specified by the parameters host and port. The socket is bound to the local network interface specified by the InetAddress localHost on port localPort.

[Android Documentation]

Requirements

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