Commit 8301e25e authored by 高辛格's avatar 高辛格

issue29

parent c34c7a71
......@@ -19,6 +19,4 @@ classes
# vim
*.swp
# go.sum
# Gopkg.lock
# vendor/
vendor/
......@@ -12,6 +12,7 @@ package getty
import (
"bytes"
"fmt"
"io"
"net"
"runtime"
"sync"
......@@ -524,7 +525,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()
}()
......@@ -720,6 +721,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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment