mirror of
https://github.com/n0-computer/iroh.git
synced 2026-11-30 08:01:44 +00:00
deploy: 5de4c007dc88d855a1ffe70f2eb2a30ff050a2d9
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Create a QUIC server that accepts connections for QUIC address discovery."><title>iroh_relay::quic - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.31.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module quic</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></span><h1>Module <span>quic</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/quic.rs.html#1-320">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a QUIC server that accepts connections
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Create a QUIC server that accepts connections for QUIC address discovery."><title>iroh_relay::quic - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-dbdb5eec.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="iroh_relay" data-themes="" data-resource-suffix="" data-rustdoc-version="1.85.0-nightly (d10a6823f 2024-11-29)" data-channel="nightly" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../../static.files/storage-59e33391.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../iroh_relay/index.html">iroh_<wbr>relay</a><span class="version">0.31.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module quic</a></h2><h3><a href="#structs">Module Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#constants" title="Constants">Constants</a></li></ul></section><div id="rustdoc-modnav"><h2 class="in-crate"><a href="../index.html">In crate iroh_<wbr>relay</a></h2></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><span class="rustdoc-breadcrumbs"><a href="../index.html">iroh_relay</a></span><h1>Module <span>quic</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/iroh_relay/quic.rs.html#1-315">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Create a QUIC server that accepts connections
|
||||
for QUIC address discovery.</p>
|
||||
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.QuicClient.html" title="struct iroh_relay::quic::QuicClient">Quic<wbr>Client</a></div><div class="desc docblock-short">Handles the client side of QUIC address discovery.</div></li></ul><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="constant" href="constant.ALPN_QUIC_ADDR_DISC.html" title="constant iroh_relay::quic::ALPN_QUIC_ADDR_DISC">ALPN_<wbr>QUIC_<wbr>ADDR_<wbr>DISC</a></div><div class="desc docblock-short">ALPN for our quic addr discovery</div></li><li><div class="item-name"><a class="constant" href="constant.QUIC_ADDR_DISC_CLOSE_CODE.html" title="constant iroh_relay::quic::QUIC_ADDR_DISC_CLOSE_CODE">QUIC_<wbr>ADDR_<wbr>DISC_<wbr>CLOSE_<wbr>CODE</a></div><div class="desc docblock-short">Endpoint close error code</div></li><li><div class="item-name"><a class="constant" href="constant.QUIC_ADDR_DISC_CLOSE_REASON.html" title="constant iroh_relay::quic::QUIC_ADDR_DISC_CLOSE_REASON">QUIC_<wbr>ADDR_<wbr>DISC_<wbr>CLOSE_<wbr>REASON</a></div><div class="desc docblock-short">Endpoint close reason</div></li></ul></section></div></main></body></html>
|
||||
File diff suppressed because one or more lines are too long
@@ -313,12 +313,7 @@
|
||||
<a href="#312" id="312">312</a>
|
||||
<a href="#313" id="313">313</a>
|
||||
<a href="#314" id="314">314</a>
|
||||
<a href="#315" id="315">315</a>
|
||||
<a href="#316" id="316">316</a>
|
||||
<a href="#317" id="317">317</a>
|
||||
<a href="#318" id="318">318</a>
|
||||
<a href="#319" id="319">319</a>
|
||||
<a href="#320" id="320">320</a></pre></div><pre class="rust"><code><span class="doccomment">//! Create a QUIC server that accepts connections
|
||||
<a href="#315" id="315">315</a></pre></div><pre class="rust"><code><span class="doccomment">//! Create a QUIC server that accepts connections
|
||||
//! for QUIC address discovery.
|
||||
</span><span class="kw">use </span>std::{net::SocketAddr, sync::Arc};
|
||||
|
||||
@@ -549,16 +544,11 @@
|
||||
server_addr: SocketAddr,
|
||||
host: <span class="kw-2">&</span>str,
|
||||
) -> <span class="prelude-ty">Result</span><(SocketAddr, std::time::Duration)> {
|
||||
<span class="macro">tracing::debug!</span>(
|
||||
<span class="string">"quic::QuicClient::get_addr_and_latency {:?}, {:?}, {server_addr:?}, {host:?}"</span>,
|
||||
<span class="self">self</span>.ep,
|
||||
<span class="self">self</span>.client_config
|
||||
);
|
||||
<span class="comment">// let connecting = self
|
||||
// .ep
|
||||
// .connect_with(self.client_config.clone(), server_addr, host);
|
||||
// let conn = connecting?.await?;
|
||||
// let mut external_addresses = conn.observed_external_addr();
|
||||
<span class="kw">let </span>connecting = <span class="self">self
|
||||
</span>.ep
|
||||
.connect_with(<span class="self">self</span>.client_config.clone(), server_addr, host);
|
||||
<span class="kw">let </span>conn = connecting<span class="question-mark">?</span>.<span class="kw">await</span><span class="question-mark">?</span>;
|
||||
<span class="comment">// let mut external_addresses = conn.observed_external_addr();
|
||||
// TODO(ramfox): I'd like to be able to cancel this so we can close cleanly
|
||||
// if there the task that runs this function gets aborted.
|
||||
// tokio::select! {
|
||||
@@ -587,10 +577,10 @@
|
||||
// // that is ivp6 then the address is an [IPv4-Mapped IPv6 Addresses](https://doc.rust-lang.org/beta/std/net/struct.Ipv6Addr.html#ipv4-mapped-ipv6-addresses)
|
||||
// observed_addr = SocketAddr::new(observed_addr.ip().to_canonical(), observed_addr.port());
|
||||
// let latency = conn.rtt() / 2;
|
||||
// // gracefully close the connections
|
||||
// conn.close(QUIC_ADDR_DISC_CLOSE_CODE, QUIC_ADDR_DISC_CLOSE_REASON);
|
||||
// Ok((observed_addr, latency))
|
||||
</span><span class="macro">anyhow::bail!</span>(<span class="string">"no qad"</span>);
|
||||
// gracefully close the connections
|
||||
</span>conn.close(QUIC_ADDR_DISC_CLOSE_CODE, QUIC_ADDR_DISC_CLOSE_REASON);
|
||||
<span class="comment">// Ok((observed_addr, latency))
|
||||
</span><span class="macro">anyhow::bail!</span>(<span class="string">"not waiting for connections in qad"</span>);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user