desktop and web working

This commit is contained in:
2024-11-08 18:18:08 -07:00
parent 86fc23b3cb
commit 011b66423a
4 changed files with 20 additions and 19 deletions
+8 -4
View File
@@ -1,6 +1,7 @@
use crate::app::Command;
use anyhow::Result;
use dioxus::hooks::{UnboundedReceiver, UnboundedSender};
use futures::io::{AsyncRead, AsyncWrite};
use mumble_protocol::control::{ClientControlCodec, ControlPacket};
use mumble_protocol::Serverbound;
use std::net::ToSocketAddrs;
@@ -15,11 +16,17 @@ use tokio_rustls::rustls::DigitallySignedStruct;
use tokio_rustls::TlsConnector;
use tokio_util::compat::{TokioAsyncReadCompatExt as _, TokioAsyncWriteCompatExt as _};
pub use tokio::task::spawn_local as spawn;
pub use tokio::task::spawn;
pub use tokio::time::sleep;
pub struct Error(anyhow::Error);
pub trait ImpRead: AsyncRead + Unpin + Send + 'static {}
impl<T: AsyncRead + Unpin + Send + 'static> ImpRead for T {}
pub trait ImpWrite: AsyncWrite + Unpin + Send + 'static {}
impl<T: AsyncWrite + Unpin + Send + 'static> ImpWrite for T {}
impl From<anyhow::Error> for Error {
fn from(value: anyhow::Error) -> Self {
Error(value)
@@ -135,9 +142,6 @@ pub async fn network_connect(
username: String,
event_rx: &mut UnboundedReceiver<Command>,
) -> Result<(), Error> {
let localset = LocalSet::new();
let _guard = localset.enter();
let config = ClientConfig::builder()
.dangerous()
.with_custom_certificate_verifier(Arc::new(NoCertificateVerification))