ing
This commit is contained in:
parent
f76a10dcd1
commit
2efb6bf2ce
|
@ -1,6 +1,7 @@
|
|||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
|
||||
cda "git.loafle.net/commons/di-go/annotation"
|
||||
|
@ -47,7 +48,11 @@ func (s *ProbeService) Send(method string, params ...interface{}) error {
|
|||
return err
|
||||
}
|
||||
|
||||
s.RPCWriteChan <- buf
|
||||
select {
|
||||
case s.RPCWriteChan <- buf:
|
||||
default:
|
||||
return fmt.Errorf("cannot write to rpcWriteChan")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package servlet
|
|||
import (
|
||||
"net"
|
||||
|
||||
logging "git.loafle.net/commons/logging-go"
|
||||
"git.loafle.net/commons/logging-go"
|
||||
crp "git.loafle.net/commons/rpc-go/protocol"
|
||||
crpj "git.loafle.net/commons/rpc-go/protocol/json"
|
||||
crr "git.loafle.net/commons/rpc-go/registry"
|
||||
|
@ -73,7 +73,11 @@ func (s *RPCServlets) Handle(servletCtx server.ServletCtx,
|
|||
}
|
||||
|
||||
writeChan <- replyBuff
|
||||
case buf := <-s.RPCWriteChan:
|
||||
case buf, ok := <-s.RPCWriteChan:
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
|
||||
writeChan <- buf
|
||||
case <-stopChan:
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user