Package org.miaixz.bus.socket.channel
Class AsynchronousSocketChannelProxy
java.lang.Object
java.nio.channels.AsynchronousSocketChannel
org.miaixz.bus.socket.channel.AsynchronousSocketChannelProxy
- All Implemented Interfaces:
Closeable,AutoCloseable,AsynchronousByteChannel,AsynchronousChannel,Channel,NetworkChannel
- Direct Known Subclasses:
SslAsynchronousSocketChannel
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAsynchronousSocketChannelProxy(AsynchronousSocketChannel asynchronousSocketChannel) -
Method Summary
Modifier and TypeMethodDescriptionbind(SocketAddress local) voidclose()connect(SocketAddress remote) <A> voidconnect(SocketAddress remote, A attachment, CompletionHandler<Void, ? super A> handler) <T> TgetOption(SocketOption<T> name) booleanisOpen()read(ByteBuffer dst) <A> voidread(ByteBuffer[] dsts, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long, ? super A> handler) <A> voidread(ByteBuffer dst, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer, ? super A> handler) setOption(SocketOption<T> name, T value) Set<SocketOption<?>> write(ByteBuffer src) <A> voidwrite(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long, ? super A> handler) <A> voidwrite(ByteBuffer src, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer, ? super A> handler)
-
Field Details
-
asynchronousSocketChannel
-
-
Constructor Details
-
AsynchronousSocketChannelProxy
-
-
Method Details
-
bind
- Specified by:
bindin interfaceNetworkChannel- Specified by:
bindin classAsynchronousSocketChannel- Throws:
IOException
-
setOption
- Specified by:
setOptionin interfaceNetworkChannel- Specified by:
setOptionin classAsynchronousSocketChannel- Throws:
IOException
-
getOption
- Throws:
IOException
-
supportedOptions
-
shutdownInput
- Specified by:
shutdownInputin classAsynchronousSocketChannel- Throws:
IOException
-
shutdownOutput
- Specified by:
shutdownOutputin classAsynchronousSocketChannel- Throws:
IOException
-
getRemoteAddress
- Specified by:
getRemoteAddressin classAsynchronousSocketChannel- Throws:
IOException
-
connect
public <A> void connect(SocketAddress remote, A attachment, CompletionHandler<Void, ? super A> handler) - Specified by:
connectin classAsynchronousSocketChannel
-
connect
- Specified by:
connectin classAsynchronousSocketChannel
-
read
public <A> void read(ByteBuffer dst, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer, ? super A> handler) - Specified by:
readin classAsynchronousSocketChannel
-
read
- Specified by:
readin interfaceAsynchronousByteChannel- Specified by:
readin classAsynchronousSocketChannel
-
read
public <A> void read(ByteBuffer[] dsts, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long, ? super A> handler) - Specified by:
readin classAsynchronousSocketChannel
-
write
public <A> void write(ByteBuffer src, long timeout, TimeUnit unit, A attachment, CompletionHandler<Integer, ? super A> handler) - Specified by:
writein classAsynchronousSocketChannel
-
write
- Specified by:
writein interfaceAsynchronousByteChannel- Specified by:
writein classAsynchronousSocketChannel
-
write
public <A> void write(ByteBuffer[] srcs, int offset, int length, long timeout, TimeUnit unit, A attachment, CompletionHandler<Long, ? super A> handler) - Specified by:
writein classAsynchronousSocketChannel
-
getLocalAddress
- Specified by:
getLocalAddressin interfaceNetworkChannel- Specified by:
getLocalAddressin classAsynchronousSocketChannel- Throws:
IOException
-
isOpen
public boolean isOpen() -
close
- Throws:
IOException
-