java.lang.Object
org.miaixz.bus.socket.plugin.AbstractPlugin<T>
org.miaixz.bus.socket.plugin.StreamMonitorPlugin<T>
传输层码流监控插件
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BiConsumer<AsynchronousSocketChannel, byte[]> static final BiConsumer<AsynchronousSocketChannel, byte[]> static final BiConsumer<AsynchronousSocketChannel, byte[]> static final BiConsumer<AsynchronousSocketChannel, byte[]> -
Constructor Summary
ConstructorsConstructorDescriptionStreamMonitorPlugin(BiConsumer<AsynchronousSocketChannel, byte[]> inputStreamConsumer, BiConsumer<AsynchronousSocketChannel, byte[]> outputStreamConsumer) -
Method Summary
Methods inherited from class org.miaixz.bus.socket.plugin.AbstractPlugin
afterRead, afterWrite, beforeRead, beforeWrite, process, stateEvent, toHex, toHexString
-
Field Details
-
BLUE_HEX_INPUT_STREAM
-
RED_HEX_OUTPUT_STREAM
-
BLUE_TEXT_INPUT_STREAM
-
RED_TEXT_OUTPUT_STREAM
-
-
Constructor Details
-
StreamMonitorPlugin
public StreamMonitorPlugin() -
StreamMonitorPlugin
public StreamMonitorPlugin(BiConsumer<AsynchronousSocketChannel, byte[]> inputStreamConsumer, BiConsumer<AsynchronousSocketChannel, byte[]> outputStreamConsumer)
-
-
Method Details
-
shouldAccept
Description copied from interface:Monitor监控已接收到的连接- Specified by:
shouldAcceptin interfaceMonitor- Overrides:
shouldAcceptin classAbstractPlugin<T>- Parameters:
channel- 当前已经建立连接的通道对象- Returns:
- 非null:接受该连接,null:拒绝该连接
-