made stub pc client

This commit is contained in:
Andy Killorin 2024-12-05 18:10:19 -05:00
commit 8f2510588f
Signed by: ank
GPG key ID: 23F9463ECB67FE8C

View file

@ -3,6 +3,7 @@ use core::{cell::RefCell, str::from_utf8};
use common::{Name, Request};
use embassy_net::tcp::TcpSocket;
use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, mutex::Mutex};
use embassy_time::Duration;
use embedded_io_async::Write;
use log::*;
use postcard::from_bytes;
@ -21,6 +22,7 @@ pub async fn server_task(stack: embassy_net::Stack<'static>) {
loop {
let mut socket = TcpSocket::new(stack, &mut rx_buffer, &mut tx_buffer);
socket.set_timeout(Some(Duration::from_secs(3)));
info!("Listening on TCP:1234...");
if let Err(e) = socket.accept(1234).await {
warn!("accept error: {:?}", e);