You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using XCode 14.2 and DNSClient 2.3.2
When resolving the packages and dependencies, XCode runs into a problem with the NioDNS package. The error message is as follows:
XCode seems to resolve the dependency graph without error, but this causes the underlying code from the DNSClient package to stop working. In the swift file "DNSClient+Connect," it can no longer find the reference "NIOTSDatagramBootstrap".
Specifically, the error occurs in the DNSClient extension:
extension DNSClient {
/// Connect to the dns server using TCP using NIOTransportServices. This is only available on iOS 12 and above.
/// - parameters:
/// - group: EventLoops to use
/// - config: DNS servers to use
/// - returns: Future with the NioDNS client. Use
public static func connectTS(on group: NIOTSEventLoopGroup, config: [SocketAddress]) -> EventLoopFuture<DNSClient> {
guard let address = config.preferred else {
return group.next().makeFailedFuture(MissingNameservers())
}
let dnsDecoder = DNSDecoder(group: group)
return NIOTSDatagramBootstrap(group: group)
.channelOption(ChannelOptions.socket(SocketOptionLevel(SOL_SOCKET), SO_REUSEADDR), value: 1)
.channelOption(ChannelOptions.socket(SocketOptionLevel(SOL_SOCKET), SO_REUSEPORT), value: 1)
.channelInitializer { channel in
return channel.pipeline.addHandlers(dnsDecoder, DNSEncoder())
}
.connect(to: address)
.map { channel -> DNSClient in
let client = DNSClient(
channel: channel,
address: address,
decoder: dnsDecoder
)
dnsDecoder.mainClient = client
return client
}
}
/// Connect to the dns server using TCP using NIOTransportServices. This is only available on iOS 12 and above.
/// The DNS Host is read from /etc/resolv.conf
/// - parameters:
/// - group: EventLoops to use
public static func connectTS(on group: NIOTSEventLoopGroup) -> EventLoopFuture<DNSClient> {
do {
let configString = try String(contentsOfFile: "/etc/resolv.conf")
let config = try ResolvConf(from: configString)
return connectTS(on: group, config: config.nameservers)
} catch {
return group.next().makeFailedFuture(UnableToParseConfig())
}
}
}
The text was updated successfully, but these errors were encountered:
Using XCode 14.2 and DNSClient 2.3.2
When resolving the packages and dependencies, XCode runs into a problem with the NioDNS package. The error message is as follows:
XCode seems to resolve the dependency graph without error, but this causes the underlying code from the DNSClient package to stop working. In the swift file "DNSClient+Connect," it can no longer find the reference "NIOTSDatagramBootstrap".
Specifically, the error occurs in the DNSClient extension:
The text was updated successfully, but these errors were encountered: