Skip to content

Commit

Permalink
Correctly register for EPOLLRDHUP when construct EpollSocketChannel f…
Browse files Browse the repository at this point in the history
…rom 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.
  • Loading branch information
normanmaurer committed Jul 21, 2015
1 parent 3d68196 commit 22cea8a
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -92,6 +92,9 @@ protected AbstractEpollStreamChannel(int fd) {

protected AbstractEpollStreamChannel(FileDescriptor fd) {
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
Expand Down

0 comments on commit 22cea8a

Please sign in to comment.