Share via


DatagramChannel.Disconnect Method

Definition

Disconnects this channel's socket.

[Android.Runtime.Register("disconnect", "()Ljava/nio/channels/DatagramChannel;", "GetDisconnectHandler")]
public abstract Java.Nio.Channels.DatagramChannel? Disconnect ();
[<Android.Runtime.Register("disconnect", "()Ljava/nio/channels/DatagramChannel;", "GetDisconnectHandler")>]
abstract member Disconnect : unit -> Java.Nio.Channels.DatagramChannel

Returns

This datagram channel

Attributes

Exceptions

some other I/O error occurs.

Remarks

Disconnects this channel's socket.

The channel's socket is configured so that it can receive datagrams from, and sends datagrams to, any remote address so long as the security manager, if installed, permits it.

This method may be invoked at any time. It will not have any effect on read or write operations that are already in progress at the moment that it is invoked.

If this channel's socket is not connected, or if the channel is closed, then invoking this method has no effect.

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

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