From 1c01c703b410a2c23f684bba8dcbe9eca37bef1e Mon Sep 17 00:00:00 2001 From: lesismal Date: Thu, 14 Sep 2023 23:42:15 +0800 Subject: [PATCH] epoll: handle err events after read/write events --- poller_epoll.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/poller_epoll.go b/poller_epoll.go index 1a93208c..a6f4e94b 100644 --- a/poller_epoll.go +++ b/poller_epoll.go @@ -188,11 +188,6 @@ func (p *poller) readWriteLoop() { default: c := p.getConn(fd) if c != nil { - if ev.Events&epollEventsError != 0 { - c.closeWithError(io.EOF) - continue - } - if ev.Events&epollEventsWrite != 0 { c.flush() } @@ -227,6 +222,11 @@ func (p *poller) readWriteLoop() { p.g.onRead(c) } } + + if ev.Events&epollEventsError != 0 { + c.closeWithError(io.EOF) + continue + } } else { syscall.Close(fd) // p.deleteEvent(fd)