Interface DatagramChannel
- All Superinterfaces:
AttributeMap, Channel, ChannelOutboundInvoker, Comparable<Channel>
- All Known Implementing Classes:
EpollDatagramChannel, KQueueDatagramChannel, NioDatagramChannel, OioDatagramChannel
-
Nested Class Summary
Nested classes/interfaces inherited from interface Channel
Channel.UnsafeModifier and TypeInterfaceDescriptionstatic interfaceUnsafe operations that should never be called from user-code. -
Method Summary
Modifier and TypeMethodDescriptionblock(InetAddress multicastAddress, InetAddress sourceToBlock) Block the given sourceToBlock address for the given multicastAddress and notifies theChannelFutureonce the operation completes.block(InetAddress multicastAddress, InetAddress sourceToBlock, ChannelPromise future) Block the given sourceToBlock address for the given multicastAddress and notifies theChannelFutureonce the operation completes.block(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress sourceToBlock) Block the given sourceToBlock address for the given multicastAddress on the given networkInterface and notifies theChannelFutureonce the operation completes.block(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress sourceToBlock, ChannelPromise future) Block the given sourceToBlock address for the given multicastAddress on the given networkInterface and notifies theChannelFutureonce the operation completes.config()Returns the configuration of this channel.booleanReturntrueif theDatagramChannelis connected to the remote peer.joinGroup(InetAddress multicastAddress) Joins a multicast group and notifies theChannelFutureonce the operation completes.joinGroup(InetAddress multicastAddress, ChannelPromise future) Joins a multicast group and notifies theChannelFutureonce the operation completes.joinGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source) Joins the specified multicast group at the specified interface and notifies theChannelFutureonce the operation completes.joinGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source, ChannelPromise future) Joins the specified multicast group at the specified interface and notifies theChannelFutureonce the operation completes.joinGroup(InetSocketAddress multicastAddress, NetworkInterface networkInterface) Joins the specified multicast group at the specified interface and notifies theChannelFutureonce the operation completes.joinGroup(InetSocketAddress multicastAddress, NetworkInterface networkInterface, ChannelPromise future) Joins the specified multicast group at the specified interface and notifies theChannelFutureonce the operation completes.leaveGroup(InetAddress multicastAddress) Leaves a multicast group and notifies theChannelFutureonce the operation completes.leaveGroup(InetAddress multicastAddress, ChannelPromise future) Leaves a multicast group and notifies theChannelFutureonce the operation completes.leaveGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source) Leave the specified multicast group at the specified interface using the specified source and notifies theChannelFutureonce the operation completes.leaveGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source, ChannelPromise future) Leave the specified multicast group at the specified interface using the specified source and notifies theChannelFutureonce the operation completes.leaveGroup(InetSocketAddress multicastAddress, NetworkInterface networkInterface) Leaves a multicast group on a specified local interface and notifies theChannelFutureonce the operation completes.leaveGroup(InetSocketAddress multicastAddress, NetworkInterface networkInterface, ChannelPromise future) Leaves a multicast group on a specified local interface and notifies theChannelFutureonce the operation completes.Returns the local address where this channel is bound to.Returns the remote address where this channel is connected to.Methods inherited from interface AttributeMap
attr, hasAttrModifier and TypeMethodDescription<T> Attribute<T> attr(AttributeKey<T> key) Get theAttributefor the givenAttributeKey.<T> booleanhasAttr(AttributeKey<T> key) Methods inherited from interface Channel
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isActive, isOpen, isRegistered, isWritable, metadata, parent, pipeline, read, unsafeModifier and TypeMethodDescriptionalloc()Return the assignedByteBufAllocatorwhich will be used to allocateByteBufs.longGet how many bytes can be written untilChannel.isWritable()returnsfalse.longGet how many bytes must be drained from underlying buffers untilChannel.isWritable()returnstrue.Returns theChannelFuturewhich will be notified when this channel is closed.flush()Request to flush all pending messages via this ChannelOutboundInvoker.id()Returns the globally unique identifier of thisChannel.booleanisActive()Returntrueif theChannelis active and so connected.booleanisOpen()Returnstrueif theChannelis open and may get active laterbooleanbooleanReturnstrueif and only if the I/O thread will perform the requested write operation immediately.metadata()parent()Returns the parent of this channel.pipeline()Return the assignedChannelPipeline.read()Request to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading.unsafe()Returns an internal-use-only object that provides unsafe operations.Methods inherited from interface ChannelOutboundInvoker
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushModifier and TypeMethodDescriptionbind(SocketAddress localAddress) Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.bind(SocketAddress localAddress, ChannelPromise promise) Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.close()Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.close(ChannelPromise promise) Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.connect(SocketAddress remoteAddress) Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.connect(SocketAddress remoteAddress, ChannelPromise promise) Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.connect(SocketAddress remoteAddress, SocketAddress localAddress) Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.deregister(ChannelPromise promise) Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.disconnect(ChannelPromise promise) Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.newFailedFuture(Throwable cause) Create a newChannelFuturewhich is marked as failed already.Return an newChannelProgressivePromiseReturn a newChannelPromise.Create a newChannelFuturewhich is marked as succeeded already.Return a special ChannelPromise which can be reused for different operations.Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.write(Object msg, ChannelPromise promise) Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.writeAndFlush(Object msg) Shortcut for callChannelOutboundInvoker.write(Object)andChannelOutboundInvoker.flush().writeAndFlush(Object msg, ChannelPromise promise) Shortcut for callChannelOutboundInvoker.write(Object, ChannelPromise)andChannelOutboundInvoker.flush().Methods inherited from interface Comparable
compareTo
-
Method Details
-
config
DatagramChannelConfig config()Description copied from interface:ChannelReturns the configuration of this channel. -
localAddress
InetSocketAddress localAddress()Description copied from interface:ChannelReturns the local address where this channel is bound to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
localAddressin interfaceChannel- Returns:
- the local address of this channel.
nullif this channel is not bound.
-
remoteAddress
InetSocketAddress remoteAddress()Description copied from interface:ChannelReturns the remote address where this channel is connected to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
remoteAddressin interfaceChannel- Returns:
- the remote address of this channel.
nullif this channel is not connected. If this channel is not connected but it can receive messages from arbitrary remote addresses (e.g.DatagramChannel, useDefaultAddressedEnvelope.recipient()to determine the origination of the received message as this method will returnnull.
-
isConnected
boolean isConnected()Returntrueif theDatagramChannelis connected to the remote peer. -
joinGroup
Joins a multicast group and notifies theChannelFutureonce the operation completes. -
joinGroup
Joins a multicast group and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned. -
joinGroup
Joins the specified multicast group at the specified interface and notifies theChannelFutureonce the operation completes. -
joinGroup
ChannelFuture joinGroup(InetSocketAddress multicastAddress, NetworkInterface networkInterface, ChannelPromise future) Joins the specified multicast group at the specified interface and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned. -
joinGroup
ChannelFuture joinGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source) Joins the specified multicast group at the specified interface and notifies theChannelFutureonce the operation completes. -
joinGroup
ChannelFuture joinGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source, ChannelPromise future) Joins the specified multicast group at the specified interface and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned. -
leaveGroup
Leaves a multicast group and notifies theChannelFutureonce the operation completes. -
leaveGroup
Leaves a multicast group and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned. -
leaveGroup
Leaves a multicast group on a specified local interface and notifies theChannelFutureonce the operation completes. -
leaveGroup
ChannelFuture leaveGroup(InetSocketAddress multicastAddress, NetworkInterface networkInterface, ChannelPromise future) Leaves a multicast group on a specified local interface and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned. -
leaveGroup
ChannelFuture leaveGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source) Leave the specified multicast group at the specified interface using the specified source and notifies theChannelFutureonce the operation completes. -
leaveGroup
ChannelFuture leaveGroup(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress source, ChannelPromise future) Leave the specified multicast group at the specified interface using the specified source and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned. -
block
ChannelFuture block(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress sourceToBlock) Block the given sourceToBlock address for the given multicastAddress on the given networkInterface and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned. -
block
ChannelFuture block(InetAddress multicastAddress, NetworkInterface networkInterface, InetAddress sourceToBlock, ChannelPromise future) Block the given sourceToBlock address for the given multicastAddress on the given networkInterface and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned. -
block
Block the given sourceToBlock address for the given multicastAddress and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned. -
block
Block the given sourceToBlock address for the given multicastAddress and notifies theChannelFutureonce the operation completes. The givenChannelFuturewill be notified and also returned.
-