InetSocketAddress.CreateUnresolved(String, Int32) Method

Definition

Creates an unresolved socket address from a hostname and a port number.

[Android.Runtime.Register("createUnresolved", "(Ljava/lang/String;I)Ljava/net/InetSocketAddress;", "")]
public static Java.Net.InetSocketAddress? CreateUnresolved (string? host, int port);
[<Android.Runtime.Register("createUnresolved", "(Ljava/lang/String;I)Ljava/net/InetSocketAddress;", "")>]
static member CreateUnresolved : string * int -> Java.Net.InetSocketAddress

Parameters

host
String

the Host name

port
Int32

The port number

Returns

an InetSocketAddress representing the unresolved socket address

Attributes

Exceptions

if the hostname host is null or the port is not in the range between 0 and 65535.

Remarks

Creates an unresolved socket address from a hostname and a port number.

No attempt will be made to resolve the hostname into an InetAddress. The address will be flagged as unresolved.

A valid port value is between 0 and 65535. A port number of zero will let the system pick up an ephemeral port in a bind operation.

Added in 1.5.

Java documentation for java.net.InetSocketAddress.createUnresolved(java.lang.String, int).

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