java.lang.Object
org.miaixz.bus.socket.Session
org.miaixz.bus.socket.accord.UdpSession
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
Fields inherited from class org.miaixz.bus.socket.Session
eof, modCount, SESSION_STATUS_CLOSED, SESSION_STATUS_CLOSING, SESSION_STATUS_ENABLED, status -
Constructor Summary
ConstructorsConstructorDescriptionUdpSession(UdpChannel udpChannel, SocketAddress remote, BufferPage writeBufferPage) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclose(boolean immediate) 为确保消息尽可能发送,UDP不支持立即close获取当前会话的本地连接地址获取当前会话的远程连接地址获取读缓冲区对象void继续触发读行为,该方法仅可在异步处理模式下可使用,否则会触发不可预知的异常获取WriteBuffer用以数据输出Methods inherited from class org.miaixz.bus.socket.Session
close, getAttachment, getInputStream, getInputStream, getSessionID, isInvalid, setAttachment
-
Constructor Details
-
UdpSession
-
-
Method Details
-
writeBuffer
Description copied from class:Session获取WriteBuffer用以数据输出- Specified by:
writeBufferin classSession- Returns:
- WriteBuffer
-
readBuffer
Description copied from class:Session获取读缓冲区对象- Specified by:
readBufferin classSession
-
awaitRead
public void awaitRead() -
signalRead
public void signalRead()Description copied from class:Session继续触发读行为,该方法仅可在异步处理模式下可使用,否则会触发不可预知的异常- Specified by:
signalReadin classSession
-
close
public void close(boolean immediate) 为确保消息尽可能发送,UDP不支持立即close -
getLocalAddress
Description copied from class:Session获取当前会话的本地连接地址- Specified by:
getLocalAddressin classSession- Returns:
- 本地地址
- Throws:
IOException- IO异常- See Also:
-
getRemoteAddress
Description copied from class:Session获取当前会话的远程连接地址- Specified by:
getRemoteAddressin classSession- Returns:
- 远程地址
- See Also:
-