|
|
@ -6,6 +6,7 @@ import ( |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
gotls "crypto/tls" |
|
|
|
gotls "crypto/tls" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"v2ray.com/core/common" |
|
|
|
"v2ray.com/core/common" |
|
|
|
"v2ray.com/core/common/net" |
|
|
|
"v2ray.com/core/common/net" |
|
|
@ -64,10 +65,14 @@ func (v *Listener) keepAccepting() { |
|
|
|
for { |
|
|
|
for { |
|
|
|
conn, err := v.listener.Accept() |
|
|
|
conn, err := v.listener.Accept() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
if strings.Contains(err.Error(), "closed") { |
|
|
|
errStr := err.Error() |
|
|
|
|
|
|
|
if strings.Contains(errStr, "closed") { |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
newError("failed to accepted raw connections").Base(err).AtWarning().WriteToLog() |
|
|
|
newError("failed to accepted raw connections").Base(err).AtWarning().WriteToLog() |
|
|
|
|
|
|
|
if strings.Contains(errStr, "too many") { |
|
|
|
|
|
|
|
time.Sleep(time.Millisecond * 500) |
|
|
|
|
|
|
|
} |
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|