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

Abstract SocketSet to AnySocketSet trait #944

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cavivie
Copy link

@cavivie cavivie commented Jul 1, 2024

No description provided.

@Dirbaio
Copy link
Member

Dirbaio commented Jul 1, 2024

I'm concerned about the extra complexity caused by having to pass the generic param through everywhere. What's the intended use case of the SocketSet trait?

There are pending possible improvements to SocketSet. For example make packet dispatch more efficient than O(n). However, this makes the trait interface only capable of iteration, which locks us into O(n) more.

@cavivie
Copy link
Author

cavivie commented Jul 2, 2024

I am considering customizing the socket set, the addition of socket, query and iteration are closely related, such as the order of socket, etc. I have some cases such as the coexistence of any port and bound port, and tcp and udp should be in different sets. Zone rapid retrieval and iteration, etc., they rely more or less on the order of socket in the set. If you want to complete some complex tasks, it is necessary to do complex processing work in the core dispatcher, and add a custom socket set trait to meet the upper dispatching requirements. I am encapsulating the upper application network protocol stack, and I have been hindered by the socket set to varying degrees. This PR will alleviate a lot of effects, which is also my original intention to do something in rust-managed.

@cavivie
Copy link
Author

cavivie commented Jul 2, 2024

Anyway, if the above arguments are agreed, then this socket set trait should define other public api other than iteration, which is worth considering. So what do you think you need to consider about this PR?

@cavivie cavivie force-pushed the socketset_trait branch 3 times, most recently from 7abdbcd to ea31e07 Compare July 2, 2024 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants