use tokio::io::{AsyncRead, AsyncWrite};
use super::PreparedApp;
use crate::{
app::{Envelope, envelope::Packet},
codec::FrameCodec,
frame::FrameMetadata,
message::{DecodeWith, EncodeWith},
serializer::Serializer,
};
impl<S, C, E, F> PreparedApp<S, C, E, F>
where
S: Serializer + FrameMetadata<Frame = Envelope> + Send + Sync + 'static,
C: Send + 'static,
E: Packet,
F: FrameCodec,
Envelope: DecodeWith<S> + EncodeWith<S>,
{
pub async fn handle_connection<W>(&self, stream: W)
where
W: AsyncRead + AsyncWrite + Send + Unpin + 'static,
{
if let Err(error) = self.handle_connection_result(stream).await {
tracing::warn!(
error = %error,
"connection handling completed with error"
);
}
}
}