<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "RealityKit",
  "identifier" : "/documentation/RealityKit/MultipeerConnectivityService/setHandshake(count:timeoutMs:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "RealityKit"
    ],
    "preciseIdentifier" : "s:10RealityKit28MultipeerConnectivityServiceC12setHandshake5count9timeoutMsys6UInt32V_AHtF"
  },
  "title" : "setHandshake(count:timeoutMs:)"
}
-->

# setHandshake(count:timeoutMs:)

Configures handshake and timeout settings.

```
func setHandshake(count: UInt32, timeoutMs: UInt32)
```

## Parameters

`count`

The maximum number of handshake packets to send to peers.

`timeoutMs`

The maximum amount of time to wait for peers to respond to
handshake packets.

## Discussion

When RealityKit begins syncing with a connected device, it sends that
device a special message, called a *handshake packet*, over the network
and waits for a response. Once it receives the correct response, it
begins syncing the local RealityKit scene with the other connected app.

By default, RealityKit sends at most two handshake packets to a peer and
waits up to 25,000 ms (25 seconds) for the peer to respond before giving
up and disconnecting. Call this method to change the timeout or the
number of handshake packets to send.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)