<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameKit",
  "identifier" : "/documentation/GameKit/GKMatch/chooseBestHostingPlayer(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GameKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKMatch(im)chooseBestHostingPlayerWithCompletionHandler:"
  },
  "title" : "chooseBestHostingPlayer(completionHandler:)"
}
-->

# chooseBestHostingPlayer(completionHandler:)

Determines the best player in the game to act as the server for a client-server topology.

```
func chooseBestHostingPlayer(completionHandler: @escaping @Sendable (GKPlayer?) -> Void)
```

## Parameters

`completionHandler`

The block that GameKit calls when it completes the request.

    The block receives the following parameter:

- `player`: The player with the best estimated network performance, or `nil` if GameKit couldn’t determine the best host.

## Discussion

This method estimates which player has the best network connection using a variety of metrics such as bandwidth, latency, and network reliability. Use this method to choose the player that acts as the server when you implement a client-server topology on top of the match’s peer-to-peer connection.

---

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)