fn each_addr<A: ToSocketAddrs, F, T>(addr: A, f: F) -> Result<T>where F: FnMut(Result<&SocketAddr>) -> Result<T>,