-
Notifications
You must be signed in to change notification settings - Fork 20
Refactor TCP logic #59
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
Conversation
b30366d to
4be8245
Compare
|
Refactoring is complete, please review it. @SajjadPourali |
80e3fe5 to
25cd26c
Compare
|
|
||
| #[tokio::main] | ||
| async fn main() -> Result<(), Box<dyn std::error::Error>> { | ||
| dotenvy::dotenv().ok(); |
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.
Did we use environment variables in this example?
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, we use .env file.
| ) -> Poll<std::io::Result<()>> { | ||
| fn poll_read(mut self: std::pin::Pin<&mut Self>, cx: &mut Context<'_>, buf: &mut tokio::io::ReadBuf<'_>) -> Poll<std::io::Result<()>> { | ||
| loop { | ||
| if self.tcb.retransmission.is_some() { |
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.
Not exactly sure how retransmission is handled here. Is this one moved to the PacketStatus::RetransmissionRequest => {...} later in the same function?
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
| tokio = { version = "1.43", default-features = false, features = [ | ||
| "rt-multi-thread", | ||
| ] } | ||
| tun = { version = "0.7.13", default-features = false, features = ["async"] } |
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.
We can also rename tun2.rs example to tun.rs if you wish
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.
ok
|
Thanks |
|
Please publish it. |
|
Now, the final problem of the crate is introducing congestion control. |
I’m doing some benchmark tests and will publish it a bit later.
Network congestion is unlikely under normal conditions for the intended use of this crate, but extreme system load or resource exhaustion may cause issues. Implementing a simple AIMD mechanism could enhance its stability. |
No description provided.