stm32/eth: add host server command example

This commit is contained in:
Badr Bouslikhin 2023-12-05 19:50:11 +01:00
parent d2a7322978
commit 0ffb35a2a1
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View File

@ -113,6 +113,7 @@ async fn main(spawner: Spawner) -> ! {
socket.set_timeout(Some(embassy_time::Duration::from_secs(10))); socket.set_timeout(Some(embassy_time::Duration::from_secs(10)));
// You need to start a server on the host machine, for example: `nc -l 8000`
let remote_endpoint = (Ipv4Address::new(10, 42, 0, 1), 8000); let remote_endpoint = (Ipv4Address::new(10, 42, 0, 1), 8000);
info!("connecting..."); info!("connecting...");
let r = socket.connect(remote_endpoint).await; let r = socket.connect(remote_endpoint).await;

View File

@ -109,6 +109,7 @@ async fn main(spawner: Spawner) -> ! {
let client = TcpClient::new(&stack, &state); let client = TcpClient::new(&stack, &state);
loop { loop {
// You need to start a server on the host machine, for example: `nc -l 8000`
let addr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(10, 42, 0, 1), 8000)); let addr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(10, 42, 0, 1), 8000));
info!("connecting..."); info!("connecting...");