This commit is contained in:
2026-01-26 13:53:51 -05:00
parent e1eff49be9
commit 53ed4775ae
19 changed files with 565 additions and 350 deletions

View File

@@ -1,5 +1,6 @@
use openworm::net::{
ClientMsg, RecvHandler, SERVER_NAME, SendResult, ServerMsg, recv_uni, send_uni,
ClientMsg, ClientMsgInst, RecvHandler, SERVER_NAME, SendResult, ServerMsg, ServerMsgInst,
recv_uni, send_uni,
};
use quinn::{
Connection, Endpoint, ServerConfig,
@@ -63,7 +64,7 @@ impl ClientSender {
self.conn.remote_address()
}
pub async fn send(&self, msg: impl Into<ServerMsg>) -> SendResult {
let msg = msg.into();
let msg = ServerMsgInst::from(msg.into());
send_uni(&self.conn, msg).await
}
}
@@ -72,7 +73,7 @@ pub trait ConAccepter: Send + Sync + 'static {
fn accept(
&self,
send: ClientSender,
) -> impl Future<Output = impl RecvHandler<ClientMsg>> + Send;
) -> impl Future<Output = impl RecvHandler<ClientMsgInst>> + Send;
}
pub fn listen(