-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
added wrapper type and todos #348
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if my comments in this review are sufficient guidance or in case you need more detailed guidance. If the latter try to be more specific on where exactly you want my guidance with.
DualPreferIpV4 | ||
} | ||
|
||
impl Default for IPModes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can easier define this by using Default
in the #[derive(..)]
above and set #[default]
above Dual,
.
@@ -23,6 +23,49 @@ use tokio::{ | |||
}, | |||
}; | |||
|
|||
#[derive(Debug, Clone, Copy, PartialEq, Eq)] | |||
enum IPModes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I wanted to go for a single IP Mode indeed, and work with wrapper types. However I think it makes more sense to define 2 enums:
enum DnsResolveIpMode
dual (default)
singleIpV4
singleIpV6
dualPreferIpv4
enum ConnectIpMode
dual (default)
ipv4
ipv6
Don't think these belong in rama-tcp
though. Probably more like in rama-net
or so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to put these in rama-net?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes as these are not specific to tcp. E.g. in a future version we'll also support udp. And other packages such as Dns might also make use of it for w/e. The common denominator is that it's all related to network protocols, as such rama-net
.
You can put it in a file created as rama-net/src/mode.rs
and just pub mod mode
in the lib.rs
file of that crate.
|
||
/* | ||
TODO - Using the wrapper types | ||
in the tcp_connect fn, update the dns type to use the DnsResolveIpMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's in async fn tcp_connect_inner<State, Dns, Connector>(
that you'll want to check for DnsResolveIpMode
.
And it's in the location where we actually establish a tcp stream that you'll check for ConnectIpMode
.
Originally I was thinking to also automatically let one influence the other, but I think it makes more sense to just let the user worry about that. E.g. if user selects Ipv6-only for DNS and ipv4-only for Connect, then that obviously will fail, but that is up to the user to then fix. No point in trying to do anything about that, as the only reasonable thing to do would be to return some kind of error, so let's not bother with that as the current error will already be fine enough.
Hi @AnkurRathore , not that it's a blocker or urgent. But given this is already a month stale. I do want to at least check in.
EIther and everything is fine. And hope you're in good health and condition. Take care! |
Hi @GlenDC ,
I would still love to work on this, but I want to ensure I’m not impacting the release schedule. If you need this prioritized or handed over, I completely understand. |
@GlenDC I have attempted to add some wrapper types, and I have some doubts implementing them which I have put as TODO in the comments. I would need your guidance on this.