public interface NetDuplexChannel<T> extends SoChannel<T>
SoChannel that has two sides that can be shutdown independently.| 限定符和类型 | 方法和说明 |
|---|---|
void |
ignoreReadEofFlag()
When shutdownOutput is called remotely, an end of read flag was encountered, which usually means closing the channel.
|
boolean |
isShutdownInput()
Returns whether the read channel is closed.
|
boolean |
isShutdownOutput()
Returns whether the write channel is closed.
|
void |
shutdownInput()
Shutdown the connection for reading without closing the channel.
|
void |
shutdownOutput()
Shutdown the connection for write without closing the channel.
|
close, closeNow, findPipeContext, getAttribute, getChannelID, getContext, getCreatedTime, getLastActiveTime, getLocalAddr, getRemoteAddr, isClient, isClose, isListen, isServer, setAttributeboolean isShutdownInput()
void shutdownInput()
void ignoreReadEofFlag()
When shutdownOutput is called remotely, an end of read flag was encountered, which usually means closing the channel. But the remote still has the ability to receive data.
so use ignoreReadEofFlag() method, keep the channel state and continue to send data
Once ignoreReadEofFlag() is activated, the release of remote connections needs to be managed manually,
leading to NetChannel leakage if not released in time
boolean isShutdownOutput()
void shutdownOutput()
Copyright © 2022–2024. All rights reserved.