Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(udp_socket): add multiple receive variants with/without path information to avoid allocating memory #92

Merged
merged 3 commits into from
Dec 12, 2023

Conversation

mlegner
Copy link
Contributor

@mlegner mlegner commented Dec 11, 2023

Depends on #91

Closes #76

@mlegner mlegner added enhancement New feature or request rust labels Dec 11, 2023
Copy link
Contributor

github-actions bot commented Dec 11, 2023

Code Coverage

Package Line Rate Health
crates/scion-proto/src 80%
crates/scion-proto/src/path/metadata 100%
crates/scion/src/daemon 95%
crates/scion-proto/src/reliable 95%
crates/scion-proto/src/address 68%
crates/scion-proto/src/packet/headers 84%
crates/scion-proto/src/path 88%
crates/scion/src 84%
crates/scion-proto/src/packet 79%
Summary 80% (1053 / 1311)

@jpcsmith
Copy link
Contributor

jpcsmith commented Dec 12, 2023

Suggestion: The function name is a bit of a mouthful. I would suggest making the default variant not return the path and use the following convention from tokio: recv(_<suffix>)?(_from)?. We would then have

  • recv
  • recv_with_path / recv_pathed
  • recv_from
  • recv_with_path_from / recv_pathed_from

or similar.

@mlegner
Copy link
Contributor Author

mlegner commented Dec 12, 2023

Sounds good, I'll change the naming and add the two missing functions.

@mlegner mlegner changed the title feat: add recv_from_without_path to avoid allocating memory feat(udp_socket): add multiple receive variants with/without path information to avoid allocating memory Dec 12, 2023
@mlegner mlegner marked this pull request as ready for review December 12, 2023 14:00
crates/scion-proto/src/packet/headers.rs Outdated Show resolved Hide resolved
crates/scion-proto/src/packet/headers.rs Outdated Show resolved Hide resolved
crates/scion/src/udp_socket.rs Show resolved Hide resolved
crates/scion/src/udp_socket.rs Outdated Show resolved Hide resolved
crates/scion/src/udp_socket.rs Show resolved Hide resolved
crates/scion/src/udp_socket.rs Outdated Show resolved Hide resolved
crates/scion/src/udp_socket.rs Outdated Show resolved Hide resolved
crates/scion/tests/test_udp_socket.rs Show resolved Hide resolved
Copy link
Contributor

@jpcsmith jpcsmith left a comment

Choose a reason for hiding this comment

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

Looks good!

crates/scion/tests/test_udp_socket.rs Show resolved Hide resolved
@jpcsmith jpcsmith merged commit 96b9dbd into main Dec 12, 2023
11 checks passed
@jpcsmith jpcsmith deleted the feat/receive-without-path branch December 12, 2023 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement receive function that does not deep-copy the path header
2 participants