-
- All Superinterfaces:
AttributeMap
,Channel
,ChannelOutboundInvoker
,Comparable<Channel>
,FuturePromiseFactory
,IoHandle
- All Known Implementing Classes:
EpollDatagramChannel
,KQueueDatagramChannel
,NioDatagramChannel
public interface DatagramChannel extends Channel
A UDP/IPChannel
.Available options
In addition to the options provided byChannel
,DatagramChannel
allows the following options in the option map:
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Future<Void>
block(InetAddress multicastAddress, InetAddress sourceToBlock)
Block the given sourceToBlock address for the given multicastAddress and notifies theFuture
once the operation completes.Future<Void>
block(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress sourceToBlock)
Block the given sourceToBlock address for the given multicastAddress on the given networkInterface and notifies theFuture
once the operation completes.boolean
isConnected()
Returntrue
if theDatagramChannel
is connected to the remote peer.Future<Void>
joinGroup(InetAddress multicastAddress)
Joins a multicast group and notifies theFuture
once the operation completes.Future<Void>
joinGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source)
Joins the specified multicast group at the specified interface and notifies theFuture
once the operation completes.Future<Void>
leaveGroup(InetAddress multicastAddress)
Leaves a multicast group and notifies theFuture
once the operation completes.Future<Void>
leaveGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source)
Leave the specified multicast group at the specified interface using the specified source and notifies theFuture
once the operation completes.-
Methods inherited from interface io.netty5.util.AttributeMap
attr, hasAttr
-
Methods inherited from interface io.netty5.channel.Channel
bind, bufferAllocator, close, closeFuture, connect, connect, deregister, disconnect, executor, flush, getOption, id, isActive, isOpen, isOptionSupported, isShutdown, isWritable, localAddress, metadata, parent, pipeline, read, register, remoteAddress, sendOutboundEvent, setOption, shutdown, writableBytes, write, writeAndFlush
-
Methods inherited from interface io.netty5.channel.ChannelOutboundInvoker
newFailedFuture, newPromise, newSucceededFuture, newSucceededFuture
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface io.netty5.channel.IoHandle
isRegistered
-
-
-
-
Method Detail
-
isConnected
boolean isConnected()
Returntrue
if theDatagramChannel
is connected to the remote peer.
-
joinGroup
Future<Void> joinGroup(InetAddress multicastAddress)
Joins a multicast group and notifies theFuture
once the operation completes.If the underlying implementation does not support this operation it will return a
Future
which is failed with anUnsupportedOperationException
.- Parameters:
multicastAddress
- the multicast group address.- Returns:
- a
Future
which is notified once the operation completes.
-
joinGroup
Future<Void> joinGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source)
Joins the specified multicast group at the specified interface and notifies theFuture
once the operation completes.If the underlying implementation does not support this operation it will return a
Future
which is failed with anUnsupportedOperationException
.- Parameters:
multicastAddress
- the multicast group address.networkInterface
- the interface to use.source
- the source address (might benull
).- Returns:
- a
Future
which is notified once the operation completes.
-
leaveGroup
Future<Void> leaveGroup(InetAddress multicastAddress)
Leaves a multicast group and notifies theFuture
once the operation completes.If the underlying implementation does not support this operation it will return a
Future
which is failed with anUnsupportedOperationException
.- Parameters:
multicastAddress
- the multicast group address.- Returns:
- a
Future
which is notified once the operation completes.
-
leaveGroup
Future<Void> leaveGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source)
Leave the specified multicast group at the specified interface using the specified source and notifies theFuture
once the operation completes.If the underlying implementation does not support this operation it will return a
Future
which is failed with anUnsupportedOperationException
.- Parameters:
multicastAddress
- the multicast group address.networkInterface
- the interface to use.source
- the source address (might benull
).- Returns:
- a
Future
which is notified once the operation completes.
-
block
Future<Void> block(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress sourceToBlock)
Block the given sourceToBlock address for the given multicastAddress on the given networkInterface and notifies theFuture
once the operation completes.If the underlying implementation does not support this operation it will return a
Future
which is failed with anUnsupportedOperationException
.- Parameters:
multicastAddress
- the multicast group address.networkInterface
- the interface to use.sourceToBlock
- the source address.- Returns:
- a
Future
which is notified once the operation completes.
-
block
Future<Void> block(InetAddress multicastAddress, InetAddress sourceToBlock)
Block the given sourceToBlock address for the given multicastAddress and notifies theFuture
once the operation completes.If the underlying implementation does not support this operation it will return a
Future
which is failed with anUnsupportedOperationException
.- Parameters:
multicastAddress
- the multicast group address.sourceToBlock
- the source address.- Returns:
- a
Future
which is notified once the operation completes.
-
-