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