Clean up --gossip-port argument (#7067)

--gossip-port now specifies exactly that, the gossip port to use.  The
new --gossip-host argument can be used to specify the DNS name/IP
address for gossip if --entrypoint is not supplied (when --entrypoint is
supplied, the gossip address is automatically set to the node's ip
address as observed by the entrypoint)
This commit is contained in:
Michael Vines
2019-11-20 15:21:34 -07:00
committed by GitHub
parent c39633f968
commit b0271394cd
5 changed files with 92 additions and 50 deletions

View File

@ -176,6 +176,10 @@ pub fn parse_host(host: &str) -> Result<IpAddr, String> {
}
}
pub fn is_host(string: String) -> Result<(), String> {
parse_host(&string).map(|_| ())
}
pub fn parse_host_port(host_port: &str) -> Result<SocketAddr, String> {
let addrs: Vec<_> = host_port
.to_socket_addrs()
@ -189,8 +193,7 @@ pub fn parse_host_port(host_port: &str) -> Result<SocketAddr, String> {
}
pub fn is_host_port(string: String) -> Result<(), String> {
parse_host_port(&string)?;
Ok(())
parse_host_port(&string).map(|_| ())
}
#[cfg(windows)]