Skip to content

Commit

Permalink
remove client connect
Browse files Browse the repository at this point in the history
Signed-off-by: iGxnon <igxnon@gmail.com>
  • Loading branch information
iGxnon committed Nov 16, 2024
1 parent 727e703 commit 28a398d
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/client/conn/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,9 @@ impl ConnectTo for TokioUdpSocket {
)> {
let socket = Arc::new(self);
let mut lookups = addrs.to_socket_addrs()?;
let addr = loop {
if let Some(addr) = lookups.next() {
if socket.connect(addr).await.is_ok() {
break addr;
}
continue;
}
return Err(io::Error::new(
io::ErrorKind::AddrNotAvailable,
"invalid address",
));
};
let addr = lookups
.next()
.ok_or_else(|| io::Error::new(io::ErrorKind::AddrNotAvailable, "invalid address"))?;

let (mut incoming, peer) = OfflineHandler::new(
Framed::new(Arc::clone(&socket), config.mtu as usize), // TODO: discover MTU
Expand Down

0 comments on commit 28a398d

Please sign in to comment.