This commit is contained in:
crusader 2018-04-19 22:51:36 +09:00
parent 2efb6bf2ce
commit 21b4085bcc

View File

@ -50,6 +50,7 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx,
err error
)
sc := crpj.NewServerCodec()
go s.handleRPCWrite(stopChan, writeChan)
for {
select {
@ -73,6 +74,15 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx,
}
writeChan <- replyBuff
case <-stopChan:
return
}
}
}
func (s *RPCServlets) handleRPCWrite(stopChan <-chan struct{}, writeChan chan<- []byte) {
for {
select {
case buf, ok := <-s.RPCWriteChan:
if !ok {
break