-
Notifications
You must be signed in to change notification settings - Fork 70
Closed
Labels
Milestone
Description
In the screenshot I have a problem with my connection and I'm unable to open connection to the shown address.
First of all, I think we should retry connection if there isn't progress in e.g. 30 seconds at this step, similar to how we reconnect if we don't hear from the server for a while.
But the actual bug is /reconnect isn't doing anything at this step. I see the code that is supposed to handle /reconnect during address name resolving step, but I don't see it in try_connect:
tiny/libtiny_client/src/lib.rs
Lines 642 to 666 in 7b858cc
| async fn try_connect( | |
| addrs: Vec<SocketAddr>, | |
| serv_name: &str, | |
| use_tls: bool, | |
| snd_ev: &mut mpsc::Sender<Event>, | |
| ) -> Option<Stream> { | |
| for addr in addrs { | |
| snd_ev.send(Event::Connecting(addr)).await.unwrap(); | |
| let mb_stream = if use_tls { | |
| Stream::new_tls(addr, &serv_name).await | |
| } else { | |
| Stream::new_tcp(addr).await | |
| }; | |
| match mb_stream { | |
| Err(err) => { | |
| snd_ev.send(Event::from(err)).await.unwrap(); | |
| } | |
| Ok(stream) => { | |
| return Some(stream); | |
| } | |
| } | |
| } | |
| None | |
| } |
I think we need to do the same there.
