When the TCP connection fails, wait 1s second before retrying

This commit is contained in:
Dreaded_X 2023-08-27 04:12:16 +02:00
parent cb3bda5a95
commit f8f45ca4e2
Signed by: Dreaded_X
GPG Key ID: 96C9F2B15F72C54B

View File

@ -19,7 +19,7 @@ use embassy_rp::{
pio::{self, Pio},
uart::{self, BufferedUartRx, Parity},
};
use embassy_time::{Duration, Ticker};
use embassy_time::{Duration, Ticker, Timer};
use embedded_io_async::Read;
@ -232,7 +232,7 @@ async fn main(spawner: Spawner) {
while let Err(e) = socket.connect(addr).await {
warn!("Connect error: {:?}", e);
continue;
Timer::after(Duration::from_secs(1)).await;
}
info!("TCP Connected!");