Do we even still need to support building without ipv6?
Moved the logic to determine which sockets to keep to a separate function and add unit tests for it. Store the port which was originally specified for a listen socket so that we can match sockets reliably even with port retries.