Compare commits

...

2 Commits

Author SHA1 Message Date
Christoph J. Scherr 557e0b61b0
fix client datatype
cargo devel CI / cargo CI (push) Failing after 1s Details
2024-02-09 18:10:02 +01:00
Christoph J. Scherr bc2b7284df
bump version
cargo devel CI / cargo CI (push) Failing after 2s Details
2024-02-09 18:06:31 +01:00
2 changed files with 3 additions and 7 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "netpong"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
publish = true
authors = ["Christoph J. Scherr <software@cscherr.de>"]

View File

@ -11,7 +11,7 @@ use tokio::{
net::TcpStream,
};
use tokio_rustls::{
rustls::{self, pki_types}, TlsConnector, TlsStream
rustls::{self, pki_types}, TlsConnector, client::TlsStream
};
use webpki_roots;
@ -20,8 +20,6 @@ const BUF_SIZE: usize = 512;
pub struct Client {
cfg: Config,
stream: TlsStream<TcpStream>,
connector: TlsConnector,
domain: pki_types::ServerName<'static>,
}
impl Client {
@ -47,13 +45,11 @@ impl Client {
return Err(err.into());
}
};
let mut stream = connector.connect(domain, TcpStream::connect(&cfg.addr).await?).await?;
let stream = connector.connect(domain.clone(), TcpStream::connect(&cfg.addr).await?).await?;
Ok(Client {
cfg: cfg.clone(),
stream,
connector,
domain,
})
}