EPOLL Shutdown Input Half Closed
Motivation: EPOLL attempts to support half closed socket, but fails to call shutdown to close the read portion of the file descriptor. Motivation: - If half closed is supported shutting down the input should call underlying Native.shutdown(...) to make sure the peer is notified of the half closed state. Result: EPOLL half closed is more correct.
This commit is contained in:
parent
2ff2806ada
commit
b2399c2475
@ -377,8 +377,14 @@ abstract class AbstractEpollChannel extends AbstractChannel implements UnixChann
|
||||
inputShutdown = true;
|
||||
if (isOpen()) {
|
||||
if (Boolean.TRUE.equals(config().getOption(ChannelOption.ALLOW_HALF_CLOSURE))) {
|
||||
clearEpollIn0();
|
||||
pipeline().fireUserEventTriggered(ChannelInputShutdownEvent.INSTANCE);
|
||||
try {
|
||||
Native.shutdown(fd().intValue(), true, false);
|
||||
clearEpollIn0();
|
||||
pipeline().fireUserEventTriggered(ChannelInputShutdownEvent.INSTANCE);
|
||||
} catch (IOException e) {
|
||||
pipeline().fireExceptionCaught(e);
|
||||
close(voidPromise());
|
||||
}
|
||||
} else {
|
||||
close(voidPromise());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user