Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServerAddress should use std::net types to pass a TCP socket. #1203

Open
JonathanWoollett-Light opened this issue Sep 15, 2024 · 2 comments
Open
Assignees

Comments

@JonathanWoollett-Light
Copy link

ServerAddress should make use of existing standard library types to pass the TCP socket e.g. SocketAddr. Passing it as a string (e.g. ServerAddress::Tcp { host "my_socket", port: Some(4040) }) is error prone.

@abr-egn
Copy link
Contributor

abr-egn commented Sep 16, 2024

Just to make sure I understand, your request is for an IP address specific variant of ServerAddress, e.g.

pub enum ServerAddress {
  Tcp { ... },
  Unix { ... },
  SocketAddr(std::net::SocketAddr),
}

?

@JonathanWoollett-Light
Copy link
Author

JonathanWoollett-Light commented Sep 16, 2024

That looks good, really any approach that passes the socket as std::net types rather than a String and a Option<u16>. Currently I'm doing Tcp { host: addr.to_string(), .. } which is pretty ugly.

@kevinAlbs kevinAlbs removed the triage label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants