Skip to content

Commit

Permalink
handle accept error, fix #607
Browse files Browse the repository at this point in the history
  • Loading branch information
yangzhe1991 committed Dec 31, 2015
1 parent 3f3ce18 commit 53bad85
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ func (s *Server) handleConns() {
for {
c, err := s.listener.Accept()
if err != nil {
if ne, ok := err.(net.Error); ok && ne.Temporary() {
log.WarnErrorf(err, "[%p] proxy accept new connection failed, get temporary error", s)
time.Sleep(time.Millisecond*10)
continue
}
log.WarnErrorf(err, "[%p] proxy accept new connection failed, get non-temporary error, must shutdown", s)
return
} else {
ch <- c
Expand Down

0 comments on commit 53bad85

Please sign in to comment.