Add Network transport adapters - #27
Closed
rchatham wants to merge 2 commits into
Closed
Conversation
…observers' into HEAD # Conflicts: # PeerConnectivity.xcodeproj/project.pbxproj # Sources/PeerAdvertiserAssisstant.swift # Sources/PeerConnectionManager.swift # Sources/PeerConnectionTransports.swift
There was a problem hiding this comment.
Pull request overview
Adds internal Network.framework transport adapters and introduces a Multipeer-specific transport protocol split so MultipeerConnectivity-only components can depend on MC capabilities while keeping the default/public backend unchanged.
Changes:
- Split
PeerSessionTransportinto genericPeerSessionTransport+ MC-specificMultipeerSessionTransport, and updated MC-only consumers accordingly. - Added internal Network.framework adapter transports and a
PeerConnectionTransportFactory.networkFrameworkfactory for wiring them. - Added Network transport adapter unit tests and updated the Xcode project to include the new sources/tests.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/PeerSession.swift | Updates PeerSession to conform to the new MC-specific transport protocol. |
| Sources/PeerConnectionTransports.swift | Introduces MultipeerSessionTransport and adds the internal Network factory wiring. |
| Sources/PeerConnectionManager.swift | Gates multipeerSession access behind MultipeerSessionTransport and updates invitation handling signature. |
| Sources/PeerBrowser.swift | Requires MultipeerSessionTransport for MC browser construction. |
| Sources/PeerAdvertiserEventProducer.swift | Updates invitation handler to require MultipeerSessionTransport so it can access MCSession. |
| Sources/PeerAdvertiserAssisstant.swift | Requires MultipeerSessionTransport for MC advertiser assistant. |
| Sources/NetworkPeerTransportAdapters.swift | Adds Network.framework transport adapter implementations (session/browser/advertiser/assistant). |
| Sources/NetworkPeerTransport.swift | Adds Network browsing/listening seams and enables post-construction handler wiring. |
| PeerConnectivityTests/NetworkPeerTransportAdapterTests.swift | Adds coverage for Network adapter factory construction and basic adapter behaviors. |
| PeerConnectivity.xcodeproj/project.pbxproj | Registers new Network adapter source/test files in the Xcode project. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Owner
Author
|
Superseded by consolidated PR #29. No commits were discarded; this branch is preserved as a recovery and reference point. Addressed review findings were replied to and resolved before consolidation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the next stacked Network migration slice: internal Network transport adapters that make the existing
NetworkPeerCoordinatorreachable through the transport factory seam, while keeping MultipeerConnectivity as the only public/default backend.Changes
MultipeerSessionTransport.PeerSessionconforming to the MC-specific transport protocol.PeerBrowser, advertiser assistant, invitation handler bridge) to requireMultipeerSessionTransport.PeerConnectionTransportFactory.networkFramework.NetworkPeerSessionTransportNetworkPeerBrowserTransportNetworkPeerAdvertiserTransportNetworkPeerAdvertiserAssisstantTransportNetworkPeerListening/NetworkPeerBrowsingtest seams.Non-goals
Verification
swift test— 84 tests passedxcodebuild test -project PeerConnectivity.xcodeproj -scheme PeerConnectivity -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.3.1' -configuration Debug— 84 tests passedStack context
Stacked on PR #25 (
feature/network-migration-async-observers). This is intended to become PR #26 in the Network migration stack.