Skip to content
Permalink
Browse files
issue29
  • Loading branch information
高辛格 authored and watermelo committed Jul 18, 2020
1 parent 941dd05 commit 622889872db2dc63d97b037c46d82adf9e6984d1
Showing 2 changed files with 8 additions and 4 deletions.
@@ -19,6 +19,4 @@ classes
# vim
*.swp

# go mod
go.mod
go.sum
vendor/
@@ -12,6 +12,7 @@ package getty
import (
"bytes"
"fmt"
"io"
"net"
"runtime"
"sync"
@@ -525,7 +526,7 @@ func (s *session) handleLoop() {

grNum := atomic.AddInt32(&(s.grNum), -1)
s.listener.OnClose(s)
log.Info("%s, [session.handleLoop] goroutine exit now, left gr num %d", s.Stat(), grNum)
log.Infof("%s, [session.handleLoop] goroutine exit now, left gr num %d", s.Stat(), grNum)
s.gc()
}()

@@ -721,6 +722,11 @@ func (s *session) handleTCPPackage() error {
if netError, ok = perrors.Cause(err).(net.Error); ok && netError.Timeout() {
break
}
if perrors.Cause(err) == io.EOF {
err = nil
exit = true
break
}
log.Errorf("%s, [session.conn.read] = error:%+v", s.sessionToken(), err)
exit = true
}

0 comments on commit 6228898

Please sign in to comment.