diff --git a/epoll.go b/epoll.go index 6a56bcf..802c9a6 100644 --- a/epoll.go +++ b/epoll.go @@ -200,14 +200,19 @@ func (ep *epoll) polling(cb func(ev *Event, res uint32), timeout int) error { } } + ET := uint32(0) + if es.epEvents&(syscall.EPOLLET&0xFFFFFFFF) != 0 { + ET = EvET + } + if evRead != nil { - cb(evRead, EvRead|EvET) + cb(evRead, EvRead|ET) } if evWrite != nil { - cb(evWrite, EvWrite|EvET) + cb(evWrite, EvWrite|ET) } if evClosed != nil { - cb(evClosed, EvClosed|EvET) + cb(evClosed, EvClosed|ET) } } diff --git a/event.go b/event.go index af94604..d92db4e 100644 --- a/event.go +++ b/event.go @@ -261,7 +261,7 @@ func (bs *EventBase) handleActiveEvents() { bs.AddEvent(ev, ev.timeout) } - ev.cb(ev.fd, ev.res&ev.events, ev.arg) + ev.cb(ev.fd, ev.res, ev.arg) } } }