---
title: "chooseBestHostPlayer(completionHandler:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gkmatch/choosebesthostplayer(completionhandler:)"
---

# chooseBestHostPlayer(completionHandler:)

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

## Declaration

```swift
func chooseBestHostPlayer(completionHandler: @escaping @Sendable (String?) -> Void)
```

```swift
func chooseBestHostPlayer() async -> String?
```

## Parameters

- `completionHandler`: The block that GameKit calls when it completes the request. The block receives the following parameter:

## Discussion

Discussion Calling this method causes GameKit to attempt to estimate which player has the best overall network connection using a variety of metrics such as bandwidth, latency, and network reliability. Typically, you call this method when your game implements a client-server model on top of the match’s peer-to-peer connection.

## See Also

### Deprecated Methods and Properties

- [playerIDs](gamekit/gkmatch/playerids.md)
- [send(_:toPlayers:with:)](gamekit/gkmatch/send(_:toplayers:with:).md)
