Skip to content
Permalink
Browse files
Fix: get error cause after server.accept
  • Loading branch information
AlexStocks authored and watermelo committed Jul 18, 2020
1 parent 1e4b65b commit 4d0b366201311759d74d4001c86d13f33b5c3ae2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
@@ -13,9 +13,10 @@ import (
"compress/flate"
"net"
"time"
)

import (
gxsync "github.com/dubbogo/gost/sync"

perrors "github.com/pkg/errors"
)

@@ -259,7 +259,7 @@ func (s *server) runTcpEventLoop(newSession NewSessionCallback) {
}
client, err = s.accept(newSession)
if err != nil {
if netErr, ok := err.(net.Error); ok && netErr.Temporary() {
if netErr, ok := perrors.Cause(err).(net.Error); ok && netErr.Temporary() {
if delay == 0 {
delay = 5 * time.Millisecond
} else {

0 comments on commit 4d0b366

Please sign in to comment.