liuxiaolong
2020-12-25 534974025fa2d6c2afe583070df79c9dd0e1d4c2
hbusc.go
@@ -6,6 +6,7 @@
   "encoding/json"
   "errors"
   "fmt"
   "os"
   "strconv"
   "sync"
   "time"
@@ -80,7 +81,7 @@
}
//Register
func Register(ctx context.Context, config *Config, ri *RegisterInfo) (*BHBus,error) {
func Register(ctx context.Context, q chan os.Signal, config *Config, ri *RegisterInfo) (*BHBus,error) {
   handle := &BHBus{
      conf: config,
      m: make(map[string]*sockServer),
@@ -113,7 +114,7 @@
loop:
   for {
      select {
      case <-ctx.Done():
      case <-q:
         return handle,errors.New("ctx is done")
      default:
         if msg == nil {