Commit 7b7480dc authored by alexstocks's avatar alexstocks

reqPkg->inPkg&rspPkg->outPkg

parent 2df48043
......@@ -17,7 +17,11 @@
>
> 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
> 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() {
err error
start time.Time
ticker *time.Ticker
reqPkg interface{}
Pkg interface{}
inPkg interface{}
outPkg interface{}
)
defer func() {
......@@ -350,13 +350,13 @@ LOOP:
case <-this.done:
log.Info("%s, [session.handleLoop] got done signal ", this.Stat())
break LOOP
case reqPkg = <-this.rQ:
case inPkg = <-this.rQ:
if this.listener != nil {
this.incReadPkgCount()
this.listener.OnMessage(this, reqPkg)
this.listener.OnMessage(this, inPkg)
}
case Pkg = <-this.wQ:
if err = this.pkgHandler.Write(this, Pkg); err != nil {
case outPkg = <-this.wQ:
if err = this.pkgHandler.Write(this, outPkg); err != nil {
log.Error("%s, [session.handleLoop] = error{%+v}", this.sessionToken(), err)
break LOOP
}
......@@ -382,15 +382,15 @@ LAST:
}
select {
case Pkg = <-this.wQ:
if err = this.pkgHandler.Write(this, Pkg); err != nil {
case outPkg = <-this.wQ:
if err = this.pkgHandler.Write(this, outPkg); err != nil {
break LAST
}
this.incWritePkgCount()
case reqPkg = <-this.rQ:
case inPkg = <-this.rQ:
if this.listener != nil {
this.incReadPkgCount()
this.listener.OnMessage(this, reqPkg)
this.listener.OnMessage(this, inPkg)
}
default:
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