public class SocketOptionPlugin<T> extends AbstractPlugin<T>
| 构造器和说明 |
|---|
SocketOptionPlugin() |
| 限定符和类型 | 方法和说明 |
|---|---|
<V> V |
getOption(SocketOption<V> socketOption) |
void |
setOption(AsynchronousSocketChannel channel)
往socket channel中设置option值。
|
<V> SocketOptionPlugin<T> |
setOption(SocketOption<V> socketOption,
V value)
设置Socket的TCP参数配置。
|
AsynchronousSocketChannel |
shouldAccept(AsynchronousSocketChannel channel) |
afterRead, afterWrite, beforeRead, beforeWrite, preProcess, stateEventpublic final AsynchronousSocketChannel shouldAccept(AsynchronousSocketChannel channel)
shouldAccept 在接口中 NetMonitorshouldAccept 在类中 AbstractPlugin<T>public void setOption(AsynchronousSocketChannel channel)
setOption(SocketOption, Object)指定的配置值绑定到每一个Socket中。
如果有个性化的需求,可以重新实现本方法。channel - public final <V> SocketOptionPlugin<T> setOption(SocketOption<V> socketOption, V value)
AIO客户端的有效可选范围为:
1. StandardSocketOptions.SO_SNDBUF
2. StandardSocketOptions.SO_RCVBUF
3. StandardSocketOptions.SO_KEEPALIVE
4. StandardSocketOptions.SO_REUSEADDR
5. StandardSocketOptions.TCP_NODELAY
socketOption - 配置项value - 配置值public final <V> V getOption(SocketOption<V> socketOption)
Copyright © 2024. All rights reserved.