|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.xnio.nio.NioTcpChannel
public final class NioTcpChannel
Nested Class Summary | |
---|---|
class |
NioTcpChannel.MBean
|
Constructor Summary | |
---|---|
NioTcpChannel(NioXnio nioXnio,
java.nio.channels.SocketChannel socketChannel,
IoHandler<? super TcpChannel> handler,
java.util.concurrent.Executor executor,
boolean manage)
|
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()
|
|
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. |
|
java.net.SocketAddress |
getPeerAddress()
Get the peer address of this channel. |
|
boolean |
isOpen()
|
|
int |
read(java.nio.ByteBuffer dst)
|
|
long |
read(java.nio.ByteBuffer[] dsts)
|
|
long |
read(java.nio.ByteBuffer[] dsts,
int offset,
int length)
|
|
void |
resumeReads()
Resume reads on this channel. |
|
void |
resumeWrites()
Resume writes on this channel. |
|
|
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()
|
|
int |
write(java.nio.ByteBuffer src)
|
|
long |
write(java.nio.ByteBuffer[] srcs)
|
|
long |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NioTcpChannel(NioXnio nioXnio, java.nio.channels.SocketChannel socketChannel, IoHandler<? super TcpChannel> handler, java.util.concurrent.Executor executor, boolean manage) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public long write(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException
write
in interface java.nio.channels.GatheringByteChannel
java.io.IOException
public long write(java.nio.ByteBuffer[] srcs) throws java.io.IOException
write
in interface java.nio.channels.GatheringByteChannel
java.io.IOException
public int write(java.nio.ByteBuffer src) throws java.io.IOException
write
in interface java.nio.channels.WritableByteChannel
java.io.IOException
public 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 long read(java.nio.ByteBuffer[] dsts, int offset, int length) throws java.io.IOException
read
in interface java.nio.channels.ScatteringByteChannel
java.io.IOException
public long read(java.nio.ByteBuffer[] dsts) throws java.io.IOException
read
in interface java.nio.channels.ScatteringByteChannel
java.io.IOException
public int read(java.nio.ByteBuffer dst) throws java.io.IOException
read
in interface java.nio.channels.ReadableByteChannel
java.io.IOException
public 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 java.net.SocketAddress getPeerAddress()
ConnectedChannel
getPeerAddress
in interface ConnectedChannel<java.net.SocketAddress>
public java.net.SocketAddress getLocalAddress()
BoundChannel
getLocalAddress
in interface BoundChannel<java.net.SocketAddress>
public <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 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 |