konne / RserveCLI2

A fork of RServeCLI
Other
30 stars 21 forks source link

Improve Connect / IP address resolution #54

Closed lahma closed 7 years ago

lahma commented 7 years ago

The connecting code was using GetHostEntryAsync when resolving IP address which does unnecessary reverse DNS lookups. Using GetHostAddressesAsync retrieves just the IPs. There's also a fast path when IP address is passed to method.

When using host name there's also optional address family parameter to allow selecting IPv4 or IPv6 address when only one of the two is supported.

I also added the optional timeout for all overloads to allow passing in from different connecting methods.