Skip to content

NetworkPreference.best should be POSIX on older platforms #896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Sources/GRPC/PlatformSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ extension NetworkPreference {
switch self.wrapped {
case .best:
#if canImport(Network)
guard #available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) else {
// This is gated by the availability of `.networkFramework` so should never happen.
fatalError(".networkFramework is being used on an unsupported platform")
if #available(OSX 10.14, iOS 12.0, tvOS 12.0, watchOS 6.0, *) {
return .networkFramework
} else {
// Older platforms must use the POSIX loop.
return .posix
}
return .networkFramework
#else
return .posix
#endif
Expand Down