Fix conflicting port for client service

pull/152/head
Rongjian Lan 6 years ago
parent bfaa0fdaef
commit c451155186
  1. 9
      node/node.go

@ -80,8 +80,8 @@ const (
syncingPortDifference = 3000 syncingPortDifference = 3000
waitBeforeJoinShard = time.Second * 3 waitBeforeJoinShard = time.Second * 3
timeOutToJoinShard = time.Minute * 10 timeOutToJoinShard = time.Minute * 10
// ClientServicePort is the port for client service // ClientServicePortDiff is the positive port diff for client service
ClientServicePort = "18411" ClientServicePortDiff = 5555
) )
// NetworkNode ... // NetworkNode ...
@ -485,8 +485,9 @@ func (node *Node) InitClientServer() {
// StartClientServer starts client server. // StartClientServer starts client server.
func (node *Node) StartClientServer() { func (node *Node) StartClientServer() {
node.log.Info("support_client: StartClientServer on port:", "port", ClientServicePort) port, _ := strconv.Atoi(node.SelfPeer.Port)
node.clientServer.Start(node.SelfPeer.IP, ClientServicePort) node.log.Info("support_client: StartClientServer on port:", "port", port + ClientServicePortDiff)
node.clientServer.Start(node.SelfPeer.IP, strconv.Itoa(port + ClientServicePortDiff))
} }
// SupportSyncing keeps sleeping until it's doing consensus or it's a leader. // SupportSyncing keeps sleeping until it's doing consensus or it's a leader.

Loading…
Cancel
Save