Correctly register for EPOLLRDHUP when construct EpollSocketChannel from FileDescriptor
Motivation: We missed to register for EPOLLRDHUP events when construct the EpollSocketChannel from an existing FileDescriptor. This could cause to miss connection-resets. Modifications: Add Native.EPOLLRDHUP to the events we are interested in. Result: Connection-resets are detected correctly.
This commit is contained in:
parent
0d73907c58
commit
1a5dac175e
@ -92,6 +92,9 @@ public abstract class AbstractEpollStreamChannel extends AbstractEpollChannel {
|
|||||||
|
|
||||||
protected AbstractEpollStreamChannel(FileDescriptor fd) {
|
protected AbstractEpollStreamChannel(FileDescriptor fd) {
|
||||||
super(null, fd, Native.EPOLLIN, Native.getSoError(fd.intValue()) == 0);
|
super(null, fd, Native.EPOLLIN, Native.getSoError(fd.intValue()) == 0);
|
||||||
|
|
||||||
|
// Add EPOLLRDHUP so we are notified once the remote peer close the connection.
|
||||||
|
flags |= Native.EPOLLRDHUP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user