Top Description Methods
org.xnio.channels

public Interface ReadableMultipointMessageChannel

extends SuspendableReadChannel
Known Direct Subinterfaces
org.xnio.channels.MultipointMessageChannel
Imports
java.nio.ByteBuffer, java.io.IOException, org.xnio.ChannelListener

The readable side of a multipoint message channel.

Method Summary

Modifier and TypeMethod and Description
public ChannelListener.Setter<? extends ReadableMultipointMessageChannel>
getCloseSetter()

Redeclares org.xnio.channels.SuspendableReadChannel.getCloseSetter.

Get the setter which can be used to change the close listener for this channel.

public ChannelListener.Setter<? extends ReadableMultipointMessageChannel>
getReadSetter()

Redeclares org.xnio.channels.SuspendableReadChannel.getReadSetter.

Get the setter which can be used to change the read listener for this channel.

public int

Returns:

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
receiveFrom
(SocketAddressBuffer
the address buffer into which the source and destination addresses should be written (null to discard that information)
addressBuffer
,
ByteBuffer
the buffer into which data should be read
buffer
)

Receive a message via this channel.

public long

Returns:

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
receiveFrom
(SocketAddressBuffer
the address buffer into which the source and destination addresses should be written (null to discard that information)
addressBuffer
,
ByteBuffer[]
the buffers that will hold the message
buffers
)

Receive a message.

public long

Returns:

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition
receiveFrom
(SocketAddressBuffer
the address buffer into which the source and destination addresses should be written (null to discard that information)
addressBuffer
,
ByteBuffer[]
the buffers that will hold the message
buffers
,
int
the offset into the array of buffers of the first buffer to read into
offs
,
int
the number of buffers to fill
len
)

Receive a message.

Inherited from org.xnio.channels.SuspendableReadChannel:
awaitReadableawaitReadablegetReadThreadisReadResumedresumeReadsshutdownReadssuspendReadswakeupReads

Method Detail

getCloseSetterback to summary
public ChannelListener.Setter<? extends ReadableMultipointMessageChannel> getCloseSetter()

Redeclares org.xnio.channels.SuspendableReadChannel.getCloseSetter.

Doc from org.xnio.channels.SuspendableReadChannel.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.

Returns:ChannelListener.Setter<? extends ReadableMultipointMessageChannel>

Doc from org.xnio.channels.CloseableChannel.getCloseSetter.

the setter

getReadSetterback to summary
public ChannelListener.Setter<? extends ReadableMultipointMessageChannel> getReadSetter()

Redeclares org.xnio.channels.SuspendableReadChannel.getReadSetter.

Doc from org.xnio.channels.SuspendableReadChannel.getReadSetter.

Get the setter which can be used to change the read listener for this channel.

Returns:ChannelListener.Setter<? extends ReadableMultipointMessageChannel>

the setter

receiveFromback to summary
public int receiveFrom(SocketAddressBuffer addressBuffer, ByteBuffer buffer) throws IOException

Receive a message via this channel. If a message is immediately available, then the datagram is written into the given buffer and the source and destination addresses (if available) read into the address buffer. If there is no message immediately available, this method will return 0.

Parameters
addressBuffer:SocketAddressBuffer

the address buffer into which the source and destination addresses should be written (null to discard that information)

buffer:ByteBuffer

the buffer into which data should be read

Returns:int

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition

Exceptions
IOException:
if an I/O error occurs
receiveFromback to summary
public long receiveFrom(SocketAddressBuffer addressBuffer, ByteBuffer[] buffers) throws IOException

Receive a message. If a message is immediately available, then the datagram is written into the given buffers in a "scatter" fashion and the source and destination addresses (if available) read into the address buffer. If there is no message immediately available, this method will return 0.

Parameters
addressBuffer:SocketAddressBuffer

the address buffer into which the source and destination addresses should be written (null to discard that information)

buffers:ByteBuffer[]

the buffers that will hold the message

Returns:long

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition

Exceptions
IOException:
if an I/O error occurs
receiveFromback to summary
public long receiveFrom(SocketAddressBuffer addressBuffer, ByteBuffer[] buffers, int offs, int len) throws IOException

Receive a message. If a message is immediately available, then the datagram is written into the given buffers in a "scatter" fashion and the source and destination addresses (if available) read into the address buffer. If there is no message immediately available, this method will return 0.

Parameters
addressBuffer:SocketAddressBuffer

the address buffer into which the source and destination addresses should be written (null to discard that information)

buffers:ByteBuffer[]

the buffers that will hold the message

offs:int

the offset into the array of buffers of the first buffer to read into

len:int

the number of buffers to fill

Returns:long

the size of the received message, 0 if no message is available, and -1 if the message channel has reached an end-of-file condition

Exceptions
IOException:
if an I/O error occurs