DatagramChannel.Open Method

Definition

Overloads

Open()

Opens a datagram channel.

Open(IProtocolFamily)

Opens a datagram channel.

Open()

Opens a datagram channel.

[Android.Runtime.Register("open", "()Ljava/nio/channels/DatagramChannel;", "")]
public static Java.Nio.Channels.DatagramChannel? Open ();
[<Android.Runtime.Register("open", "()Ljava/nio/channels/DatagramChannel;", "")>]
static member Open : unit -> Java.Nio.Channels.DatagramChannel

Returns

A new datagram channel

Attributes

Exceptions

if some I/O error occurs.

Remarks

Opens a datagram channel.

The new channel is created by invoking the java.nio.channels.spi.SelectorProvider#openDatagramChannel() openDatagramChannel method of the system-wide default java.nio.channels.spi.SelectorProvider object. The channel will not be connected.

The ProtocolFamily ProtocolFamily of the channel's socket is platform (and possibly configuration) dependent and therefore unspecified. The #open(ProtocolFamily) open allows the protocol family to be selected when opening a datagram channel, and should be used to open datagram channels that are intended for Internet Protocol multicasting.

Java documentation for java.nio.channels.DatagramChannel.open().

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

Open(IProtocolFamily)

Opens a datagram channel.

[Android.Runtime.Register("open", "(Ljava/net/ProtocolFamily;)Ljava/nio/channels/DatagramChannel;", "", ApiSince=24)]
public static Java.Nio.Channels.DatagramChannel? Open (Java.Net.IProtocolFamily? family);
[<Android.Runtime.Register("open", "(Ljava/net/ProtocolFamily;)Ljava/nio/channels/DatagramChannel;", "", ApiSince=24)>]
static member Open : Java.Net.IProtocolFamily -> Java.Nio.Channels.DatagramChannel

Parameters

family
IProtocolFamily

The protocol family

Returns

A new datagram channel

Attributes

Remarks

Opens a datagram channel.

The family parameter is used to specify the ProtocolFamily. If the datagram channel is to be used for IP multicasting then this should correspond to the address type of the multicast groups that this channel will join.

The new channel is created by invoking the java.nio.channels.spi.SelectorProvider#openDatagramChannel(ProtocolFamily) openDatagramChannel method of the system-wide default java.nio.channels.spi.SelectorProvider object. The channel will not be connected.

Added in 1.7.

Java documentation for java.nio.channels.DatagramChannel.open(java.net.ProtocolFamily).

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