whereby ai_protocol = 17 is IPPROTO_UDP and ai_protocol = 6 is IPPROTO_TCP. But since we know which one we want we should query correctly.
Steps to reproduce
connect to say 127.0.0.1
set a break point at the last line of private func parseResults(_ info: UnsafeMutablePointer<addrinfo>, host: String)
If possible, minimal yet complete reproducer code (or URL to code)
bootstrap.connect(host: "127.0.0.1", port: 1234)
SwiftNIO version/commit hash
1.2.0
Swift & OS version (output of swift --version && uname -a)
$ uname -a
Darwin jwmbp.local 17.5.0 Darwin Kernel Version 17.5.0: Mon Jan 22 18:03:58 PST 2018; root:xnu-4570.50.252~1/DEVELOPMENT_X86_64 x86_64
$ swift --version
Apple Swift version 4.0.3 (swiftlang-900.0.71 clang-900.0.38)
Target: x86_64-apple-macosx10.9
Expected behavior
When asking getaddrinfo about an IP address, we should not get two results that contain the same IP address.
Actual behavior
we do get two, example here:
whereby
ai_protocol = 17
isIPPROTO_UDP
andai_protocol = 6
isIPPROTO_TCP
. But since we know which one we want we should query correctly.Steps to reproduce
127.0.0.1
private func parseResults(_ info: UnsafeMutablePointer<addrinfo>, host: String)
If possible, minimal yet complete reproducer code (or URL to code)
bootstrap.connect(host: "127.0.0.1", port: 1234)
SwiftNIO version/commit hash
1.2.0
Swift & OS version (output of
swift --version && uname -a
)