AlexPikalov / cdrs

Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async
Apache License 2.0
341 stars 58 forks source link

Cannot use hostname instead of IP-address #322

Closed Cronnay closed 4 years ago

Cronnay commented 4 years ago

Hi there!

Maybe I have been reading the documentation poorly, in that case I apologize. Found similar issues, but they seem to be resolved.

If I run let node = NodeTcpConfigBuilder::new("192.168.145.139:9042", NoneAuthenticator {}).build(); this will build and work fine. However, if I run:
let node = NodeTcpConfigBuilder::new("database:9042", NoneAuthenticator {}).build(); I get this message from the compiler: General("invalid IP address syntax")'.

Why can't I use hostname?

My toml

[dependencies]
cdrs = "2.3.0"

Cargo --version cargo 1.42.0 (86334295e 2020-01-31)

AlexPikalov commented 4 years ago

Hi @Cronnay, You are correct host resolving functionality is missed, unfortunatelly.

AlexPikalov commented 4 years ago

I'm going to check if simple SocketAddr::from before creating a TcpStream would help

AlexPikalov commented 4 years ago

Hi @Cronnay Could you please check if https://github.com/AlexPikalov/cdrs/pull/324? It must fix the problem you're facing. If it works I'll be happy to publish the fix asap