service: reset tempDelay when retrying after accept error #52

This commit is contained in:
ginuerzh
2025-06-28 18:11:13 +08:00
parent c8d905dea5
commit 97ed5080a6
6 changed files with 17 additions and 11 deletions
+4
View File
@@ -166,6 +166,10 @@ func (s *defaultService) Serve() error {
for {
conn, e := s.listener.Accept()
if e != nil {
if _, ok := e.(*listener.AcceptError); ok {
tempDelay = 0
}
// TODO: remove Temporary checking
if ne, ok := e.(net.Error); ok && ne.Temporary() {
if tempDelay == 0 {