---
title: "disconnectPeer(fromAllPeers:)"
framework: gamekit
role: symbol
role_heading: Instance Method
path: "gamekit/gksession/disconnectpeer(fromallpeers:)"
---

# disconnectPeer(fromAllPeers:)

Disconnects a connected peer from all peers connected to the session.

## Declaration

```swift
func disconnectPeer(fromAllPeers peerID: String!)
```

## Parameters

- `peerID`: A string identifying the peer to disconnect.

## See Also

### Working with Connected Peers

- [setDataReceiveHandler(_:withContext:)](gamekit/gksession/setdatareceivehandler(_:withcontext:).md)
- [send(_:toPeers:with:)](gamekit/gksession/send(_:topeers:with:).md)
- [sendData(toAllPeers:with:)](gamekit/gksession/senddata(toallpeers:with:).md)
- [disconnectTimeout](gamekit/gksession/disconnecttimeout.md)
- [disconnectFromAllPeers()](gamekit/gksession/disconnectfromallpeers().md)
