influxdb-cpp icon indicating copy to clipboard operation
influxdb-cpp copied to clipboard

Added conversion of hostname to IP

Open gollumben opened this issue 4 years ago • 2 comments

Dear Orca,

thank you very much for this neat piece of code!

I added the support to connect to influxdb using the hostname instead of the IP address.

Cheers, Ben

gollumben avatar Nov 07 '19 09:11 gollumben

Please accept this pull request since I had to add it manually once I cloned the repo without knowing that this was already solved but not added.

manubrulo avatar Jul 17 '20 11:07 manubrulo

Dear Ben,

Thanks to your contribution.

The feature helps when put in a hostname instead of IP address.

But inet_ntoa is not thread-safe, inet_ntop maybe better.

And I think new solution should be found to instead std::exit when failed to translate hostname to IP address.

Best Regards, Orca

orca-zhang avatar Nov 16 '21 13:11 orca-zhang