Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

QUIC p2p#70

Closed
kim wants to merge 45 commits intomasterfrom
quic2
Closed

QUIC p2p#70
kim wants to merge 45 commits intomasterfrom
quic2

Conversation

@kim
Copy link
Copy Markdown
Contributor

@kim kim commented Mar 11, 2020

Still bit of cleanup and docs required. Look at examples/mesh.rs to see actual git cloning in action

@kim kim mentioned this pull request Mar 12, 2020
@kim kim marked this pull request as ready for review March 17, 2020 20:43
@kim kim requested a review from a team as a code owner March 17, 2020 20:43
@kim kim requested a review from a team March 17, 2020 20:43
@kim
Copy link
Copy Markdown
Contributor Author

kim commented Mar 18, 2020

I think this is good to go now, as most improvements (imho) are already captured in issues, and I don't want it to grow even bigger.

@FintanH @massimiliano-mantione let me know if you want this to stay open for studying. I'll do all further work in separate branches on top of this, tho.

Copy link
Copy Markdown
Contributor

@FintanH FintanH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, looks good to me. Harder to review something so large so I appreciate the run down. I think I'll get it more when I have to interact with the code :)

export: peer.paths.projects_dir().into(),
};

let endpoint = Endpoint::bind(&key, "127.0.0.1:0".parse().unwrap()).await?;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that this is the example so I don't expect squeaky clean code, but there seems to be a mix unwrap and ? in this body, any reason why?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unwrap is for parsing of the SocketAddr, which we “know” is well-formed. The bind can still fail with an IO error.

Idk, maybe there is a macro somewhere which can validate IP addresses statically, or we can write one? I’m guessing that we will have more than one hard-coded address down the road.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be possible to use Ipv4Addr::new(127, 0, 0, 1)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah missed that. It's a bit verbose, tho (note the port number)

.await
.unwrap();

let disco = discovery::Static::new(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕺

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m still pondering over a combinator for discos, which abides to the law that when you combine two discos you get a new disco with two dance floors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could also have fun things like:
disco.dancing_at_the_disco_everybody_lets_go_wheres_me_jumper_wheres_me_jumper()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do jumpers form a monoid?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Monoid in the category of cardigans

@kim
Copy link
Copy Markdown
Contributor Author

kim commented Mar 19, 2020

Closed via 294b785

@kim kim closed this Mar 19, 2020
@kim kim deleted the quic2 branch March 19, 2020 14:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants