embassy_socket/tcp_server/
callback.rs1use embassy_net::IpEndpoint;
2use crate::channel::WriteChannel;
3use crate::err::SocketErr;
4
5pub trait TcpServerCallBack {
7 type T;
9
10 async fn conn<const CN: usize>(&self, endpoint: IpEndpoint, wch: &WriteChannel<'_, CN>, t: &mut Self::T);
12
13 async fn dis_conn(&self, endpoint: IpEndpoint, t: &mut Self::T);
15
16 async fn recv<const CN: usize>(&self, endpoint: IpEndpoint, buf: &[u8], wch: &WriteChannel<'_, CN>, t: &mut Self::T);
18
19 async fn err(&self, err: SocketErr, t: &mut Self::T);
23}