code: func (s *StanServer) ensureRunningStandAlone() error {
  	clusterID := s.info.ClusterID
  	hbInbox := nats.NewInbox()
  	timeout := time.Millisecond * 250
  
  	// We cannot use the client's API here as it will create a dependency
  	// cycle in the streaming client, so build our request and see if we
  	// get a response.
  	req := &pb.ConnectRequest{ClientID: clusterID, HeartbeatInbox: hbInbox}
  	b, _ := req.Marshal()
  	reply, err := s.nc.Request(s.info.Discovery, b, timeout)
  	if err == nats.ErrTimeout {
  		s.log.Debugf("Did not detect another server instance")
  		return nil
  	}
  	if err != nil {
  		return fmt.Errorf("request error detecting another server instance: %v", err)
  	}
  	// See if the response is valid and can be unmarshalled.
  	cr := &pb.ConnectResponse{}
  	err = cr.Unmarshal(reply.Data)
  	if err != nil {
  		// Something other than a compatible streaming server responded.
  		// This may cause other problems in the long run, so better fail
  		// the startup early.
  		return fmt.Errorf("unmarshall error while detecting another server instance: %v", err)
  	}
  	// Another streaming server was found, cleanup then return error.
  	clreq := &pb.CloseRequest{ClientID: clusterID}
  	b, _ = clreq.Marshal()
  	s.nc.Request(cr.CloseRequests, b, timeout)
  	return fmt.Errorf("discovered another streaming server with cluster ID %q", clusterID)
  }
docs: // ensureRunningStandAlone prevents this streaming server from starting
  // if another is found using the same cluster ID - a possibility when
  // routing is enabled.
  // This runs under sever's lock so nothing should grab the server lock here.