Skip to content

Commit

Permalink
opt epoll et events
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed Jul 11, 2024
1 parent e02c35f commit df30d0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions nbhttp/websocket/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ func (w *writeBuffer) Close() error {

// CloseAndClean .
func (c *Conn) CloseAndClean(err error) {
// c.WriteClose(1000, "normal close")
c.mux.Lock()
if c.closed {
c.mux.Unlock()
Expand Down
2 changes: 2 additions & 0 deletions poller_epoll.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ func (p *poller) setRead(op int, fd int) error {
Events: events | syscall.EPOLLOUT,
})
}
return nil
}
return syscall.EpollCtl(p.epfd, op, fd, &syscall.EpollEvent{
Fd: int32(fd),
Expand Down Expand Up @@ -390,6 +391,7 @@ func (p *poller) setReadWrite(op int, fd int) error {
Events: events,
})
}
return nil
}
return syscall.EpollCtl(p.epfd, op, fd, &syscall.EpollEvent{
Fd: int32(fd),
Expand Down

0 comments on commit df30d0d

Please sign in to comment.