MCPcopy
hub / github.com/CodisLabs/codis / acceptConn

Method acceptConn

pkg/proxy/proxy.go:443–459  ·  view source on GitHub ↗
(l net.Listener)

Source from the content-addressed store, hash-verified

441}
442
443func (s *Proxy) acceptConn(l net.Listener) (net.Conn, error) {
444 var delay = &DelayExp2{
445 Min: 10, Max: 500,
446 Unit: time.Millisecond,
447 }
448 for {
449 c, err := l.Accept()
450 if err != nil {
451 if e, ok := err.(net.Error); ok && e.Temporary() {
452 log.WarnErrorf(err, "[%p] proxy accept new connection failed", s)
453 delay.Sleep()
454 continue
455 }
456 }
457 return c, err
458 }
459}
460
461type Overview struct {
462 Version string `json:"version"`

Callers 1

serveProxyMethod · 0.95

Calls 2

WarnErrorfMethod · 0.80
SleepMethod · 0.65

Tested by

no test coverage detected