community – ThreadOpenConnections and break versus proceed: why the one versus the opposite?

on

|

views

and

comments


Within the interior loop of ThreadOpenConnections() typically there’s a break to the outer loop and typically a proceed. That is my understanding of the distinction, roughly:

  • A break absolutely ‘restarts’ the seek for an outward connection, the kind of which shall be decided once more. Additionally new incoming potential friends shall be included within the addrman tables.
  • A proceed effectivily simply asks addrman for a subsequent candidate peer from the prevailing tables. The kind of outward connection that we want for stays the identical.

My query is concerning the selection of break versus proceed in two circumstances. Right here the code does a break:

// if we chosen an invalid or native deal with, restart
if (!addr.IsValid() || IsLocal(addr)) {
    break;
}

Whereas a couple of strains under it continues:

if (!IsReachable(addr))
    proceed;

My query is: why ‘restart’ within the first code snippet and never proceed? In different phrases: why not ask addrman a couple of instances extra, as it would provide a legitimate deal with quickly? Or, for the second snippet, if we acquired an unreachable deal with: why not restart, so addrman may get refreshed with extra reachable addresses?

I attempted to search out the reply by monitoring again the historical past of this a part of the code. The break within the first code snippet above seems to stem from the introduction of the deal with supervisor (pr/787). It didn’t appear to reply my query.

Share this
Tags

Must-read

Waymo raises $16bn to gas international robotaxi enlargement | Know-how

Self-driving automobile firm Waymo on Monday stated it raised $16bn in a funding spherical that valued the Alphabet subsidiary at $126bn.Waymo co-chief executives...

Self-driving taxis are coming to London – ought to we be anxious? | Jack Stilgoe

At the top of the nineteenth century, the world’s main cities had an issue. The streets had been flooded with manure, the unintended...

US regulators open inquiry into Waymo self-driving automobile that struck youngster in California | Expertise

The US’s federal transportation regulator stated Thursday it had opened an investigation after a Waymo self-driving car struck a toddler close to an...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here