Commit 5d412f1b authored by AlexStocks's avatar AlexStocks

Fix: get error cause after server.accept

parent 29640086
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment