https://github.com/theolampert/peerstream
Async/Await stream-based API for Multipeer Connectivity
https://github.com/theolampert/peerstream
async-await multipeer-connectivity multipeerconnectivity peer-to-peer stream swift
Last synced: 10 months ago
JSON representation
Async/Await stream-based API for Multipeer Connectivity
- Host: GitHub
- URL: https://github.com/theolampert/peerstream
- Owner: theolampert
- License: mit
- Created: 2023-05-31T12:17:48.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-02T14:57:10.000Z (about 3 years ago)
- Last Synced: 2025-06-01T15:28:10.012Z (about 1 year ago)
- Topics: async-await, multipeer-connectivity, multipeerconnectivity, peer-to-peer, stream, swift
- Language: Swift
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### PeerStream
A simple wrapper around Multipeer Connectivity using async iterator streams.
```swift
let peerStream: PeerStream = PeerStream()
Task {
for try await message in peerStream {
switch message {
case .onStateChange(state: let state, peer: let peer):
print("STREAM", state == .connected, peer.displayName)
default:
break
}
}
}
```