|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.xnio.nio.NioUdpSocketChannelImpl
public class NioUdpSocketChannelImpl
Nested Class Summary | |
---|---|
class |
NioUdpSocketChannelImpl.ReadHandler
|
class |
NioUdpSocketChannelImpl.WriteHandler
|
Nested classes/interfaces inherited from interface org.jboss.xnio.channels.UdpChannel |
---|
UdpChannel.Key |
Method Summary | ||
---|---|---|
void |
awaitReadable()
Block until this channel becomes readable again. |
|
void |
awaitReadable(long time,
java.util.concurrent.TimeUnit timeUnit)
Block until this channel becomes readable again, or until the timeout expires. |
|
void |
awaitWritable()
Block until this channel becomes writable again. |
|
void |
awaitWritable(long time,
java.util.concurrent.TimeUnit timeUnit)
Block until this channel becomes writable again, or until the timeout expires. |
|
void |
close()
|
|
IoHandler<? super UdpChannel> |
getHandler()
|
|
java.net.SocketAddress |
getLocalAddress()
Get the local address that this channel is bound to. |
|
|
getOption(ChannelOption<T> option)
Get the value of a channel option. |
|
java.util.Set<ChannelOption<?>> |
getOptions()
Get the options that may be set on this channel. |
|
boolean |
isOpen()
|
|
UdpChannel.Key |
join(java.net.InetAddress group,
java.net.NetworkInterface iface)
Join a multicast group to begin receiving all datagrams sent to the group. |
|
UdpChannel.Key |
join(java.net.InetAddress group,
java.net.NetworkInterface iface,
java.net.InetAddress source)
Join a multicast group to begin receiving all datagrams sent to the group from a given source address. |
|
MultipointReadResult<java.net.SocketAddress> |
receive(java.nio.ByteBuffer buffer)
Receive a message via this channel. |
|
void |
resumeReads()
Resume reads on this channel. |
|
void |
resumeWrites()
Resume writes on this channel. |
|
boolean |
send(java.net.SocketAddress target,
java.nio.ByteBuffer buffer)
Send a buffer to a destination. |
|
boolean |
send(java.net.SocketAddress target,
java.nio.ByteBuffer[] dsts)
Send a message with data from multiple buffers to a destination. |
|
boolean |
send(java.net.SocketAddress target,
java.nio.ByteBuffer[] dsts,
int offset,
int length)
Send a message with data from multiple buffers to a destination. |
|
|
setOption(ChannelOption<T> option,
T value)
Set an option for this channel. |
|
void |
shutdownReads()
Places this readable channel at "end of stream". |
|
void |
shutdownWrites()
Indicate that writing is complete for this channel. |
|
void |
suspendReads()
Suspend further reads on this channel. |
|
void |
suspendWrites()
Suspend further writes on this channel. |
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public java.net.SocketAddress getLocalAddress()
BoundChannel
getLocalAddress
in interface BoundChannel<java.net.SocketAddress>
public MultipointReadResult<java.net.SocketAddress> receive(java.nio.ByteBuffer buffer) throws java.io.IOException
MultipointReadableMessageChannel
null
.
receive
in interface MultipointReadableMessageChannel<java.net.SocketAddress>
buffer
- the buffer into which data should be read
null
if the operation would block
java.io.IOException
- if an I/O error occurspublic boolean isOpen()
isOpen
in interface java.nio.channels.Channel
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.nio.channels.Channel
java.io.IOException
public boolean send(java.net.SocketAddress target, java.nio.ByteBuffer buffer) throws java.io.IOException
MultipointWritableMessageChannel
send
in interface MultipointWritableMessageChannel<java.net.SocketAddress>
target
- the destinationbuffer
- the data to send
true
if the message was sent, or false
if the channel is not currently writable
java.io.IOException
- if an I/O error occurspublic boolean send(java.net.SocketAddress target, java.nio.ByteBuffer[] dsts) throws java.io.IOException
MultipointWritableMessageChannel
send
in interface MultipointWritableMessageChannel<java.net.SocketAddress>
target
- the destinationdsts
- the data to send
true
if the message was sent, or false
if the channel is not currently writable
java.io.IOException
- if an I/O error occurspublic boolean send(java.net.SocketAddress target, java.nio.ByteBuffer[] dsts, int offset, int length) throws java.io.IOException
MultipointWritableMessageChannel
send
in interface MultipointWritableMessageChannel<java.net.SocketAddress>
target
- the destinationdsts
- the data to sendoffset
- the offset into the buffers
arraylength
- the number of buffers to read from
true
if the message was sent, or false
if the channel is not currently writable
java.io.IOException
- if an I/O error occurspublic void suspendReads()
SuspendableReadChannel
IoReadHandler.handleReadable(java.nio.channels.Channel)
method will not
be called until reads are resumed.
suspendReads
in interface SuspendableReadChannel
public void suspendWrites()
SuspendableWriteChannel
IoWriteHandler.handleWritable(java.nio.channels.Channel)
method will not
be called until writes are resumed.
suspendWrites
in interface SuspendableWriteChannel
public void resumeReads()
SuspendableReadChannel
IoReadHandler.handleReadable(java.nio.channels.Channel)
method will be
called as soon as there is data available to be read.
resumeReads
in interface SuspendableReadChannel
public void resumeWrites()
SuspendableWriteChannel
IoWriteHandler.handleWritable(java.nio.channels.Channel)
method will be
called as soon as there is space in the channel's transmit buffer.
resumeWrites
in interface SuspendableWriteChannel
public void shutdownReads() throws java.io.IOException
SuspendableReadChannel
shutdownReads
in interface SuspendableReadChannel
java.io.IOException
- if an I/O error occurspublic void shutdownWrites() throws java.io.IOException
SuspendableWriteChannel
shutdownWrites
in interface SuspendableWriteChannel
java.io.IOException
- if an I/O error occurspublic void awaitReadable() throws java.io.IOException
SuspendableReadChannel
awaitReadable
in interface SuspendableReadChannel
java.io.IOException
- if an I/O error occurspublic void awaitReadable(long time, java.util.concurrent.TimeUnit timeUnit) throws java.io.IOException
SuspendableReadChannel
awaitReadable
in interface SuspendableReadChannel
time
- the time to waittimeUnit
- the time unit
java.io.IOException
- if an I/O error occurspublic void awaitWritable() throws java.io.IOException
SuspendableWriteChannel
awaitWritable
in interface SuspendableWriteChannel
java.io.IOException
- if an I/O error occurspublic void awaitWritable(long time, java.util.concurrent.TimeUnit timeUnit) throws java.io.IOException
SuspendableWriteChannel
awaitWritable
in interface SuspendableWriteChannel
time
- the time to waittimeUnit
- the time unit
java.io.IOException
- if an I/O error occurspublic UdpChannel.Key join(java.net.InetAddress group, java.net.NetworkInterface iface) throws java.io.IOException
UdpChannel
join
in interface UdpChannel
group
- the multicast address to joiniface
- the network interface to join on
java.io.IOException
- if an I/O error occurspublic UdpChannel.Key join(java.net.InetAddress group, java.net.NetworkInterface iface, java.net.InetAddress source) throws java.io.IOException
UdpChannel
join
in interface UdpChannel
group
- the multicast address to joiniface
- the network interface to join onsource
- the source address to listen for
java.io.IOException
- if an I/O error occurspublic <T> T getOption(ChannelOption<T> option) throws UnsupportedOptionException, java.io.IOException
Configurable
getOption
in interface Configurable
T
- the type of the option valueoption
- the option to get
UnsupportedOptionException
- if the option is not supported by this channel
java.io.IOException
- if an I/O error occurred when reading the optionpublic java.util.Set<ChannelOption<?>> getOptions()
Configurable
getOptions
in interface Configurable
public <T> Configurable setOption(ChannelOption<T> option, T value) throws java.lang.IllegalArgumentException, java.io.IOException
Configurable
setOption
in interface Configurable
T
- the type of the option valueoption
- the option to setvalue
- the value of the option to set
UnsupportedOptionException
- if the option is not supported by this channel
java.lang.IllegalArgumentException
- if the value is not acceptable for this option
java.io.IOException
- if an I/O error occured when modifying the optionpublic IoHandler<? super UdpChannel> getHandler()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |