Commit 7b7480dc authored by alexstocks's avatar alexstocks

reqPkg->inPkg&rspPkg->outPkg

parent 2df48043
......@@ -4,61 +4,65 @@
## introdction ##
---
> DESC : a asynchronous network I/O library in golang
LICENCE : Apache License 2.0
> DESC : a asynchronous network I/O library in golang
LICENCE : Apache License 2.0
## develop history ##
---
- 2016/08/25
> 1 move close done to once clause in server.go:(Server)stop
> 1 move close done to once clause in server.go:(Server)stop
>
> 2 rename reqQ to rQ which means read queue and its relative params
> 2 rename reqQ to rQ which means read queue and its relative params
>
> 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
> 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()
>
> 2 add once for session.go:Session:done(chan struct{})
> 2 add once for session.go:Session:done(chan struct{})
>
> 3 version: 0.2.05
> 3 version: 0.2.05
- 2016/08/23
> 1 do not consider empty package as a error in (Session)handlePackage
> 1 do not consider empty package as a error in (Session)handlePackage
>
> 2 version: 0.2.04
> 2 version: 0.2.04
- 2016/08/22
> 1 rename (Session)OnIdle to (Session)OnCron
> 1 rename (Session)OnIdle to (Session)OnCron
>
> 2 rewrite server.go: add Server{done, wg}
> 2 rewrite server.go: add Server{done, wg}
>
> 3 add utils.go
> 3 add utils.go
>
> 4 version: 0.2.03
> 4 version: 0.2.03
- 2016/08/21
> 1 add name for Session
> 1 add name for Session
>
> 2 add OnError for Codec
> 2 add OnError for Codec
- 2016/08/18
> 1 delete last clause of handleRead
> 1 delete last clause of handleRead
>
> 2 add reqQ handle case in last clause of handleLoop
> 2 add reqQ handle case in last clause of handleLoop
>
> 3 add conditon check in (*Session)RunEventLoop()
> 3 add conditon check in (*Session)RunEventLoop()
>
> 4 version: 0.2.02
> 4 version: 0.2.02
- 2016/08/16
> 1 rename all structs
> 1 rename all structs
>
> 2 add getty connection
> 2 add getty connection
>
> 3 rewrite (Session)handleRead & (Session)handleEventLoop
> 3 rewrite (Session)handleRead & (Session)handleEventLoop
>
> 4 version: 0.2.01
> 4 version: 0.2.01
......@@ -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