Skip to content

Commit

Permalink
expose EvET
Browse files Browse the repository at this point in the history
  • Loading branch information
pilot committed Aug 16, 2023
1 parent 5f03d2a commit dd5867f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions epoll.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit dd5867f

Please sign in to comment.