-
- All Superinterfaces:
java.lang.AutoCloseable
,java.nio.channels.Channel
,java.io.Closeable
,CloseableChannel
,Configurable
,java.nio.channels.InterruptibleChannel
,SuspendableWriteChannel
- All Known Subinterfaces:
BoundMultipointMessageChannel
,MulticastMessageChannel
,MultipointMessageChannel
public interface WritableMultipointMessageChannel extends SuspendableWriteChannel
The writable side of a multipoint message channel.- See Also:
MultipointMessageChannel
-
-
Field Summary
-
Fields inherited from interface org.xnio.channels.Configurable
EMPTY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChannelListener.Setter<? extends WritableMultipointMessageChannel>
getCloseSetter()
Get the setter which can be used to change the close listener for this channel.ChannelListener.Setter<? extends WritableMultipointMessageChannel>
getWriteSetter()
Get the setter which can be used to change the write listener for this channel.boolean
sendTo(java.net.SocketAddress target, java.nio.ByteBuffer buffer)
Send a buffer to a destination.boolean
sendTo(java.net.SocketAddress target, java.nio.ByteBuffer[] buffers)
Send a message with data from multiple buffers to a destination.boolean
sendTo(java.net.SocketAddress target, java.nio.ByteBuffer[] buffers, int offset, int length)
Send a message with data from multiple buffers to a destination.-
Methods inherited from interface org.xnio.channels.CloseableChannel
getIoThread, getWorker
-
Methods inherited from interface org.xnio.channels.Configurable
getOption, setOption, supportsOption
-
Methods inherited from interface org.xnio.channels.SuspendableWriteChannel
awaitWritable, awaitWritable, close, flush, getWriteThread, isOpen, isWriteResumed, resumeWrites, shutdownWrites, suspendWrites, wakeupWrites
-
-
-
-
Method Detail
-
sendTo
boolean sendTo(java.net.SocketAddress target, java.nio.ByteBuffer buffer) throws java.io.IOException
Send a buffer to a destination.- Parameters:
target
- the destinationbuffer
- the data to send- Returns:
true
if the message was sent, orfalse
if the channel is not currently writable- Throws:
java.io.IOException
- if an I/O error occurs
-
sendTo
boolean sendTo(java.net.SocketAddress target, java.nio.ByteBuffer[] buffers) throws java.io.IOException
Send a message with data from multiple buffers to a destination.- Parameters:
target
- the destinationbuffers
- the data to send- Returns:
true
if the message was sent, orfalse
if the channel is not currently writable- Throws:
java.io.IOException
- if an I/O error occurs
-
sendTo
boolean sendTo(java.net.SocketAddress target, java.nio.ByteBuffer[] buffers, int offset, int length) throws java.io.IOException
Send a message with data from multiple buffers to a destination.- Parameters:
target
- the destinationbuffers
- the data to sendoffset
- the offset into thebuffers
arraylength
- the number of buffers to read from- Returns:
true
if the message was sent, orfalse
if the channel is not currently writable- Throws:
java.io.IOException
- if an I/O error occurs
-
getWriteSetter
ChannelListener.Setter<? extends WritableMultipointMessageChannel> getWriteSetter()
Get the setter which can be used to change the write listener for this channel.- Specified by:
getWriteSetter
in interfaceSuspendableWriteChannel
- Returns:
- the setter
-
getCloseSetter
ChannelListener.Setter<? extends WritableMultipointMessageChannel> getCloseSetter()
Get the setter which can be used to change the close listener for this channel. If the channel is already closed, then the listener will not be called.- Specified by:
getCloseSetter
in interfaceCloseableChannel
- Specified by:
getCloseSetter
in interfaceSuspendableWriteChannel
- Returns:
- the setter
-
-