Correctly set EPOLLRDHUP for all stream channels.

Motivation:

Fix regression introduced by 585ce1593f, which missed to set EPOLLRDHUP for all stream channels.

Modifications:

Correctly set EPOLLRDHUP for all stream channels in the AbstractEpollStreamChannel constructor.

Result:

No more test failures in EpollDomain*Channel tests.
This commit is contained in:
Norman Maurer 2015-02-07 21:29:46 +01:00
parent a41b46ff43
commit 3ca6e4bd54
2 changed files with 4 additions and 4 deletions

View File

@ -51,10 +51,14 @@ public abstract class AbstractEpollStreamChannel extends AbstractEpollChannel {
protected AbstractEpollStreamChannel(Channel parent, int fd) { protected AbstractEpollStreamChannel(Channel parent, int fd) {
super(parent, fd, Native.EPOLLIN, true); super(parent, fd, Native.EPOLLIN, true);
// Add EPOLLRDHUP so we are notified once the remote peer close the connection.
flags |= Native.EPOLLRDHUP;
} }
protected AbstractEpollStreamChannel(int fd) { protected AbstractEpollStreamChannel(int fd) {
super(fd, Native.EPOLLIN); super(fd, Native.EPOLLIN);
// Add EPOLLRDHUP so we are notified once the remote peer close the connection.
flags |= Native.EPOLLRDHUP;
} }
@Override @Override

View File

@ -37,8 +37,6 @@ public final class EpollSocketChannel extends AbstractEpollStreamChannel impleme
EpollSocketChannel(Channel parent, int fd) { EpollSocketChannel(Channel parent, int fd) {
super(parent, fd); super(parent, fd);
// Add EPOLLRDHUP so we are notified once the remote peer close the connection.
flags |= Native.EPOLLRDHUP;
config = new EpollSocketChannelConfig(this); config = new EpollSocketChannelConfig(this);
// Directly cache the remote and local addresses // Directly cache the remote and local addresses
// See https://github.com/netty/netty/issues/2359 // See https://github.com/netty/netty/issues/2359
@ -48,8 +46,6 @@ public final class EpollSocketChannel extends AbstractEpollStreamChannel impleme
public EpollSocketChannel() { public EpollSocketChannel() {
super(Native.socketStreamFd()); super(Native.socketStreamFd());
// Add EPOLLRDHUP so we are notified once the remote peer close the connection.
flags |= Native.EPOLLRDHUP;
config = new EpollSocketChannelConfig(this); config = new EpollSocketChannelConfig(this);
} }