Skip to content

Commit

Permalink
fix: check outbound buffer in case the socket has been released
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Feb 3, 2021
1 parent 4ecbc50 commit 035f614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eventloop_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (el *eventloop) loopOpen(c *conn) error {
func (el *eventloop) loopRead(c *conn) error {
// If there is pending data in outbound buffer, then we should omit this readable event
// and prioritize the writable events to achieve a higher performance.
if !c.outboundBuffer.IsEmpty() {
if !c.opened || !c.outboundBuffer.IsEmpty() {
return nil
}

Expand Down

0 comments on commit 035f614

Please sign in to comment.