Skip to content

SocketEndpoint can have multiple endpoints#1

Merged
propertone merged 4 commits intomainfrom
multiple_socket_endpoints
Jul 30, 2025
Merged

SocketEndpoint can have multiple endpoints#1
propertone merged 4 commits intomainfrom
multiple_socket_endpoints

Conversation

@propertone
Copy link
Copy Markdown
Member

Refactor code to support this

Refactor code to support this
@propertone propertone self-assigned this Jul 5, 2025
@propertone propertone requested review from Copilot and mkomitee July 5, 2025 21:13

This comment was marked as outdated.

Copy link
Copy Markdown

@mkomitee mkomitee left a comment

Choose a reason for hiding this comment

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

I think we should look into copilots suggestions here.

src/main.rs Outdated
peer.endpoints
.iter()
.fold(HashMap::new(), |mut acc, endpoint| {
let key = format!("{}[{}]", endpoint.name, endpoint.pid);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If key is used solely for the purpose of having a distinct hash key, then I think copilot's suggestion would be better.

@propertone propertone requested a review from mkomitee July 10, 2025 14:10
@propertone propertone requested a review from Copilot July 19, 2025 16:50

This comment was marked as outdated.

@propertone propertone requested a review from Copilot July 19, 2025 17:08
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the SocketEndpoint structure to support multiple endpoints instead of a single endpoint, enabling better representation of socket connections where multiple file descriptors may be associated with the same socket inode.

  • Changed SocketEndpoint.endpoint field from single FDEndpoint to Vec<FDEndpoint> to support multiple endpoints
  • Updated the display logic to group and format multiple endpoints by process ID, showing them in a compact format like foo[123][4,5]
  • Modified the socket mapping logic to collect all file descriptors associated with a socket inode and sort them consistently

@propertone propertone merged commit 9eb3a2b into main Jul 30, 2025
@propertone propertone deleted the multiple_socket_endpoints branch July 30, 2025 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants