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

Add conversion method for Addr #4716

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

masa-koz
Copy link
Contributor

Description

This pull request includes significant changes to the src/lib.rs file and updates to the Cargo.toml file to improve the handling of socket addresses and address families. The most important changes include the addition of new dependencies, the removal of redundant structures, and the introduction of new methods for address conversion and retrieval.

Dependency Updates:

  • Added socket2 crate to Cargo.toml for enhanced socket address handling.

Code Refactoring and Improvements:

  • Replaced our own sockaddr_in and sockaddr_in6 structures with c_types::sockaddr_in and c_types::sockaddr_in6 .
  • Added methods to the Addr union for converting to and from std::net::SocketAddr, and for retrieving port numbers.
  • Implemented get_local_addr and get_remote_addr methods in the Connection struct to retrieve local and remote addresses.

Event Handling Enhancements:

  • Updated the test_conn_callback function to print local and remote addresses upon connection.

Testing

cargo test

Documentation

TBD

@masa-koz masa-koz requested a review from a team as a code owner December 19, 2024 05:44
@nibanks nibanks added external Proposed by non-MSFT Language: Rust Related to the Rust interop layer labels Dec 19, 2024
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.66%. Comparing base (f8e9cec) to head (150f9b6).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4716      +/-   ##
==========================================
- Coverage   86.90%   86.66%   -0.25%     
==========================================
  Files          56       56              
  Lines       17363    17363              
==========================================
- Hits        15090    15048      -42     
- Misses       2273     2315      +42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nibanks nibanks merged commit a03d5c2 into microsoft:main Dec 19, 2024
483 of 484 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Proposed by non-MSFT Language: Rust Related to the Rust interop layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants