Skip to content

Commit

Permalink
docs: remove line referring to back-off
Browse files Browse the repository at this point in the history
  • Loading branch information
b-zee authored and bochaco committed Dec 12, 2022
1 parent 7909ca5 commit 8a2c455
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ use super::{
};
use futures::StreamExt;
use quinn::Endpoint as QuinnEndpoint;
use std::{
net::{IpAddr, SocketAddr},
};
use std::net::{IpAddr, SocketAddr};
use tokio::sync::broadcast::{self, Sender};
use tokio::sync::mpsc::{self, error::TryRecvError, Receiver as MpscReceiver};
use tokio::time::{timeout, Duration};
Expand Down Expand Up @@ -97,20 +95,20 @@ impl Endpoint {
EndpointError,
> {
let config = InternalConfig::try_from_config(config)?;
let local_addr = local_addr.into();

let (termination_tx, termination_rx) = broadcast::channel(1);

let (mut quinn_endpoint, quinn_incoming) =
QuinnEndpoint::server(config.server.clone(), local_addr)?;

let quinn_endpoint_socket_addr = quinn_endpoint.local_addr()?;
QuinnEndpoint::server(config.server.clone(), local_addr.into())?;

// set client config used for any outgoing connections
quinn_endpoint.set_default_client_config(config.client);

// Get actual socket address.
let local_addr = quinn_endpoint.local_addr()?;

let mut endpoint = Self {
local_addr: quinn_endpoint_socket_addr,
local_addr,
public_addr: None, // we'll set this below
quinn_endpoint,
termination_tx,
Expand Down Expand Up @@ -280,7 +278,6 @@ impl Endpoint {

/// Attempt a connection to a node_addr.
///
/// All failures are retried with exponential back-off.
/// It will always try to open a new connection.
async fn new_connection(
&self,
Expand Down

0 comments on commit 8a2c455

Please sign in to comment.