Skip to content

Commit

Permalink
remove closed event
Browse files Browse the repository at this point in the history
  • Loading branch information
cheng-zhongliang committed Oct 5, 2023
1 parent 0179c1b commit 79dd4c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (ev *Event) Assign(base *EventBase, fd int, events uint32, callback func(fd
// Timeout is the timeout of the event. Default is 0, which means no timeout.
// But if EvTimeout is set in the event, the 0 represents expired immediately.
func (ev *Event) Attach(timeout time.Duration) error {
if ev.events&(EvRead|EvWrite|EvClosed|EvTimeout) == 0 {
if ev.events&(EvRead|EvWrite|EvTimeout) == 0 {
return ErrEventInvalid
}

Expand Down Expand Up @@ -236,7 +236,7 @@ func (bs *EventBase) addEvent(ev *Event) error {

bs.eventQueueInsert(ev, evListInserted)

if ev.events&(EvRead|EvWrite|EvClosed) != 0 {
if ev.events&(EvRead|EvWrite) != 0 {
return bs.poller.add(ev)
}

Expand All @@ -251,7 +251,7 @@ func (bs *EventBase) delEvent(ev *Event) error {

bs.eventQueueRemove(ev, evListInserted)

if ev.events&(EvRead|EvWrite|EvClosed) != 0 {
if ev.events&(EvRead|EvWrite) != 0 {
return bs.poller.del(ev)
}

Expand Down

0 comments on commit 79dd4c8

Please sign in to comment.