Compare commits
No commits in common. "3a4d7c934e46efedc762629549efe6acb75748c3" and "05ba4822f831cba1e3e15798722da766a8f0f46a" have entirely different histories.
3a4d7c934e
...
05ba4822f8
|
@ -29,9 +29,7 @@ async fn main () -> anyhow::Result <()> {
|
||||||
let listen_addr = opt.listen_addr.unwrap_or_else (|| String::from ("0.0.0.0:30380")).parse ()?;
|
let listen_addr = opt.listen_addr.unwrap_or_else (|| String::from ("0.0.0.0:30380")).parse ()?;
|
||||||
let (mut incoming, server_cert) = make_server_endpoint (listen_addr)?;
|
let (mut incoming, server_cert) = make_server_endpoint (listen_addr)?;
|
||||||
println! ("Base64 cert: {}", base64::encode (&server_cert));
|
println! ("Base64 cert: {}", base64::encode (&server_cert));
|
||||||
|
tokio::fs::write ("quic_server.crt", &server_cert).await?;
|
||||||
tokio::fs::create_dir_all ("ptth_quic_output").await?;
|
|
||||||
tokio::fs::write ("ptth_quic_output/quic_server.crt", &server_cert).await?;
|
|
||||||
|
|
||||||
let relay_state = Arc::new (RelayState::default ());
|
let relay_state = Arc::new (RelayState::default ());
|
||||||
|
|
||||||
|
@ -201,8 +199,8 @@ struct RequestP2ToP4 {
|
||||||
client_id: String,
|
client_id: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct PtthNewConnection {
|
struct PtthNewConnection <ClientSend: AsyncWrite + Unpin> {
|
||||||
client_send: quinn::SendStream,
|
client_send: ClientSend,
|
||||||
client_recv: quinn::RecvStream,
|
client_recv: quinn::RecvStream,
|
||||||
server_send: quinn::SendStream,
|
server_send: quinn::SendStream,
|
||||||
server_recv: quinn::RecvStream,
|
server_recv: quinn::RecvStream,
|
||||||
|
@ -213,7 +211,7 @@ struct PtthConnection {
|
||||||
downlink_task: JoinHandle <anyhow::Result <()>>,
|
downlink_task: JoinHandle <anyhow::Result <()>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PtthNewConnection {
|
impl <ClientSend: AsyncWrite + Unpin> PtthNewConnection <ClientSend> {
|
||||||
fn build (self) -> PtthConnection {
|
fn build (self) -> PtthConnection {
|
||||||
let Self {
|
let Self {
|
||||||
mut client_send,
|
mut client_send,
|
||||||
|
|
|
@ -18,7 +18,9 @@ pub use anyhow::{
|
||||||
pub use futures_util::StreamExt;
|
pub use futures_util::StreamExt;
|
||||||
pub use tokio::{
|
pub use tokio::{
|
||||||
io::{
|
io::{
|
||||||
|
AsyncRead,
|
||||||
AsyncReadExt,
|
AsyncReadExt,
|
||||||
|
AsyncWrite,
|
||||||
AsyncWriteExt,
|
AsyncWriteExt,
|
||||||
},
|
},
|
||||||
net::TcpListener,
|
net::TcpListener,
|
||||||
|
|
Loading…
Reference in New Issue