ing
This commit is contained in:
parent
2efb6bf2ce
commit
21b4085bcc
|
@ -50,6 +50,7 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx,
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
sc := crpj.NewServerCodec()
|
sc := crpj.NewServerCodec()
|
||||||
|
go s.handleRPCWrite(stopChan, writeChan)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
@ -73,6 +74,15 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx,
|
||||||
}
|
}
|
||||||
|
|
||||||
writeChan <- replyBuff
|
writeChan <- replyBuff
|
||||||
|
case <-stopChan:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *RPCServlets) handleRPCWrite(stopChan <-chan struct{}, writeChan chan<- []byte) {
|
||||||
|
for {
|
||||||
|
select {
|
||||||
case buf, ok := <-s.RPCWriteChan:
|
case buf, ok := <-s.RPCWriteChan:
|
||||||
if !ok {
|
if !ok {
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue
Block a user