code: func (rw *pssRPCRW) handshake(retries int, sync bool, flush bool) (string, error) {
  
  	var symkeyids []string
  	var i int
  	// request new keys
  	// if the key buffer was depleted, make this as a blocking call and try several times before giving up
  	for i = 0; i < 1+retries; i++ {
  		log.Debug("handshake attempt pssrpcrw", "pubkeyid", rw.pubKeyId, "topic", rw.topic, "sync", sync)
  		err := rw.Client.rpc.Call(&symkeyids, "pss_handshake", rw.pubKeyId, rw.topic, sync, flush)
  		if err == nil {
  			var keyid string
  			if sync {
  				keyid = symkeyids[0]
  			}
  			return keyid, nil
  		}
  		if i-1+retries > 1 {
  			time.Sleep(time.Millisecond * handshakeRetryTimeout)
  		}
  	}
  
  	return "", fmt.Errorf("handshake failed after %d attempts", i)
  }
docs: // retry and synchronicity wrapper for handshake api call
  // returns first new symkeyid upon successful execution