Fix epoll status event masks. Fixes #10.

This commit is contained in:
Sönke Ludwig 2017-06-10 00:06:29 +02:00
parent 1ff3d00020
commit 8e385d8b1d
No known key found for this signature in database
GPG key ID: D95E8DB493EE314C

View file

@ -69,7 +69,7 @@ final class EpollEventLoop : PosixEventLoop {
ev.events |= EPOLLET; ev.events |= EPOLLET;
if (mask & EventMask.read) ev.events |= EPOLLIN; if (mask & EventMask.read) ev.events |= EPOLLIN;
if (mask & EventMask.write) ev.events |= EPOLLOUT; if (mask & EventMask.write) ev.events |= EPOLLOUT;
if (mask & EventMask.status) ev.events |= EPOLLERR|EPOLLRDHUP|EPOLLRDHUP; if (mask & EventMask.status) ev.events |= EPOLLERR|EPOLLHUP|EPOLLRDHUP;
ev.data.fd = cast(int)fd; ev.data.fd = cast(int)fd;
() @trusted { epoll_ctl(m_epoll, EPOLL_CTL_ADD, cast(int)fd, &ev); } (); () @trusted { epoll_ctl(m_epoll, EPOLL_CTL_ADD, cast(int)fd, &ev); } ();
} }
@ -88,7 +88,7 @@ final class EpollEventLoop : PosixEventLoop {
//ev.events = EPOLLONESHOT; //ev.events = EPOLLONESHOT;
if (mask & EventMask.read) ev.events |= EPOLLIN; if (mask & EventMask.read) ev.events |= EPOLLIN;
if (mask & EventMask.write) ev.events |= EPOLLOUT; if (mask & EventMask.write) ev.events |= EPOLLOUT;
if (mask & EventMask.status) ev.events |= EPOLLERR|EPOLLRDHUP; if (mask & EventMask.status) ev.events |= EPOLLERR|EPOLLHUP|EPOLLRDHUP;
ev.data.fd = cast(int)fd; ev.data.fd = cast(int)fd;
() @trusted { epoll_ctl(m_epoll, EPOLL_CTL_MOD, cast(int)fd, &ev); } (); () @trusted { epoll_ctl(m_epoll, EPOLL_CTL_MOD, cast(int)fd, &ev); } ();
} }