Commit 7b7480dc authored by alexstocks's avatar alexstocks

reqPkg->inPkg&rspPkg->outPkg

parent 2df48043
...@@ -17,7 +17,11 @@ ...@@ -17,7 +17,11 @@
> >
> 3 rename rspQ to wQ which means write queue and its relative params > 3 rename rspQ to wQ which means write queue and its relative params
> >
> 4 version: 0.2.06 > 4 rename reqPkg to inPkg in function session.go:(Session)handleLoop
>
> 5 rename rspPkg to outPkg in function session.go:(Session)handleLoop
>
> 6 version: 0.2.06
- 2016/08/24 - 2016/08/24
> 1 delete session.go:Session:wg(atomic.WaitGroup). Add session.go:Session:grNum instead to prevent from (Session)Close() block on session.go:Session:wg.Wait() > 1 delete session.go:Session:wg(atomic.WaitGroup). Add session.go:Session:grNum instead to prevent from (Session)Close() block on session.go:Session:wg.Wait()
......
...@@ -318,8 +318,8 @@ func (this *Session) handleLoop() { ...@@ -318,8 +318,8 @@ func (this *Session) handleLoop() {
err error err error
start time.Time start time.Time
ticker *time.Ticker ticker *time.Ticker
reqPkg interface{} inPkg interface{}
Pkg interface{} outPkg interface{}
) )
defer func() { defer func() {
...@@ -350,13 +350,13 @@ LOOP: ...@@ -350,13 +350,13 @@ LOOP:
case <-this.done: case <-this.done:
log.Info("%s, [session.handleLoop] got done signal ", this.Stat()) log.Info("%s, [session.handleLoop] got done signal ", this.Stat())
break LOOP break LOOP
case reqPkg = <-this.rQ: case inPkg = <-this.rQ:
if this.listener != nil { if this.listener != nil {
this.incReadPkgCount() this.incReadPkgCount()
this.listener.OnMessage(this, reqPkg) this.listener.OnMessage(this, inPkg)
} }
case Pkg = <-this.wQ: case outPkg = <-this.wQ:
if err = this.pkgHandler.Write(this, Pkg); err != nil { if err = this.pkgHandler.Write(this, outPkg); err != nil {
log.Error("%s, [session.handleLoop] = error{%+v}", this.sessionToken(), err) log.Error("%s, [session.handleLoop] = error{%+v}", this.sessionToken(), err)
break LOOP break LOOP
} }
...@@ -382,15 +382,15 @@ LAST: ...@@ -382,15 +382,15 @@ LAST:
} }
select { select {
case Pkg = <-this.wQ: case outPkg = <-this.wQ:
if err = this.pkgHandler.Write(this, Pkg); err != nil { if err = this.pkgHandler.Write(this, outPkg); err != nil {
break LAST break LAST
} }
this.incWritePkgCount() this.incWritePkgCount()
case reqPkg = <-this.rQ: case inPkg = <-this.rQ:
if this.listener != nil { if this.listener != nil {
this.incReadPkgCount() this.incReadPkgCount()
this.listener.OnMessage(this, reqPkg) this.listener.OnMessage(this, inPkg)
} }
default: default:
log.Info("%s, [session.handleLoop] default", this.sessionToken()) log.Info("%s, [session.handleLoop] default", this.sessionToken())
......
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