work
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user