Make sure we create correct socket family. (#334)
Make sure we create correct socket family. (#334)

Motivation:

If a server binds "localhost", and then we try to connect with an
AF_INET socket, then on macOS at least some of the time we will have
a protocol mismatch, as at least some of the time localhost will have
resolved to ::1 before 127.0.0.1.

That's bad.

Modifications:

Create a socket whose address family matches the server's.

Result:

This test will pass more often
apple/swift-nio,apple/swift-nio,apple/swift-nio,apple/swift-nio,apple/swift-nio