Skip to content

Commit

Permalink
Fix go client is not show in the service subscription list (#142)
Browse files Browse the repository at this point in the history
* fix subscribe fail
  • Loading branch information
mark4z committed Oct 25, 2020
1 parent 4d437b4 commit fb45465
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion clients/naming_client/host_reator.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func NewHostReactor(serviceProxy NamingProxy, cacheDir string, updateThreadNum i
updateTimeMap: cache.NewConcurrentMap(),
updateCacheWhenEmpty: updateCacheWhenEmpty,
}
pr := NewPushRecevier(&hr)
pr := NewPushReceiver(&hr)
hr.pushReceiver = *pr
if !notLoadCacheAtStart {
hr.loadCacheFromDisk()
Expand Down
14 changes: 8 additions & 6 deletions clients/naming_client/push_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ var (
GZIP_MAGIC = []byte("\x1F\x8B")
)

func NewPushRecevier(hostReactor *HostReactor) *PushReceiver {
func NewPushReceiver(hostReactor *HostReactor) *PushReceiver {
pr := PushReceiver{
hostReactor: hostReactor,
}
go pr.startServer()
pr.startServer()
return &pr
}

Expand Down Expand Up @@ -90,10 +90,12 @@ func (us *PushReceiver) startServer() {
}
}

defer conn.Close()
for {
us.handleClient(conn)
}
go func() {
defer conn.Close()
for {
us.handleClient(conn)
}
}()
}

func (us *PushReceiver) handleClient(conn *net.UDPConn) {
Expand Down
2 changes: 1 addition & 1 deletion common/constant/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const (
KEY_BEAT = "beat"
KEY_DOM = "dom"
DEFAULT_CONTEXT_PATH = "/nacos"
CLIENT_VERSION = "Nacos-go-Client:v1.0.1"
CLIENT_VERSION = "Nacos-Go-Client:v1.0.1"
REQUEST_DOMAIN_RETRY_TIME = 3
SERVICE_INFO_SPLITER = "@@"
CONFIG_INFO_SPLITER = "@@"
Expand Down

0 comments on commit fb45465

Please sign in to comment.