Socket.ConnectAsync will create socket and handle the address family
itself. This solves some compatibility issues on win7.
Signed-off-by: noisyfox <timemanager.rick@gmail.com>
-Use dual-mode socket & DnsEndPoint to handle all domain name connection.
-Move all socket creation into one single function.
So that we could treat domain name just like ipv4 & ipv6 address.
This also solves the async domain solving problem because the os will
hanlde it for us.
- use null conditional access in case some connections been
cancelled unexpectedly and may cause null reference exception
- Refine error message
- use conditional operator to simplify some code
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>