use tokio::io::{AsyncRead, AsyncWrite};
#[deprecated(note = "use qmux::ws::Server instead")]
#[derive(Default, Clone)]
pub struct Server {
inner: qmux::ws::Server,
}
#[allow(deprecated)]
impl Server {
pub fn new() -> Self {
Self::default()
}
pub fn with_protocol(mut self, protocol: &str) -> Self {
self.inner = self.inner.with_protocol(protocol);
self
}
pub fn with_protocols(mut self, protocols: &[&str]) -> Self {
self.inner = self.inner.with_protocols(protocols);
self
}
pub async fn accept<T: AsyncRead + AsyncWrite + Unpin + Send + 'static>(
&self,
socket: T,
) -> Result<qmux::Session, qmux::Error> {
self.inner.accept(socket).await
}
}