-
Notifications
You must be signed in to change notification settings - Fork 12
Code formating and refine #4
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
Open
ssrlive
wants to merge
20
commits into
opensource-3d-p:master
Choose a base branch
from
ssrlive:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
bfbbd1d
cargo fmt && cargo clippy
ssrlive 6fbd736
bind argument
ssrlive 7721e0f
upgrade to clap 4.4.x
ssrlive a80178b
refine code
ssrlive 508d4a7
rustfmt max_width = 140
ssrlive 3d0f1e9
temp result
ssrlive 6262199
socket2 imported
ssrlive 94568ba
refactor BoxResult
ssrlive bdc9b10
tcp_stream_try_clone function
ssrlive b33c1f2
make rperf as a lib
ssrlive 59471a5
verbosity
ssrlive 5365d90
fix mio poll issues
ssrlive 4cbf40b
windows issues
ssrlive eb084fe
Merge pull request #1 from ssrlive/mio
ssrlive f5778a4
Complete adjustments as recommended.
ssrlive ec65bb9
fix issues that always timeout in windows
ssrlive e988f5d
Merge pull request #2 from ssrlive/mywin
ssrlive db7106b
refine code
ssrlive 5c7fa18
unit-tests issues fixing
ssrlive fb68b59
UDP-receive logic grouped all packets into a single interval, which b…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| pub mod args; | ||
| pub mod client; | ||
| pub(crate) mod protocol; | ||
| pub mod server; | ||
| pub(crate) mod stream; | ||
| pub(crate) mod utils; | ||
|
|
||
| pub(crate) type BoxResult<T> = Result<T, Box<dyn std::error::Error + Send + Sync + 'static>>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,8 +34,7 @@ use crate::protocol::communication::{receive, send, KEEPALIVE_DURATION}; | |
| use crate::protocol::messaging::{prepare_connect, prepare_connect_ready}; | ||
| use crate::protocol::results::ServerDoneResult; | ||
| use crate::stream::{tcp, udp, TestStream}; | ||
|
|
||
| type BoxResult<T> = Result<T, Box<dyn std::error::Error + Send + Sync + 'static>>; | ||
| use crate::BoxResult; | ||
|
|
||
| const POLL_TIMEOUT: Duration = Duration::from_millis(500); | ||
|
|
||
|
|
@@ -335,7 +334,14 @@ pub fn serve(args: &Args) -> BoxResult<()> { | |
| let mut events = Events::with_capacity(32); | ||
|
|
||
| while is_alive() { | ||
| poll.poll(&mut events, Some(POLL_TIMEOUT))?; | ||
| if let Err(err) = poll.poll(&mut events, Some(POLL_TIMEOUT)) { | ||
| if err.kind() == std::io::ErrorKind::Interrupted { | ||
| log::debug!("Poll interrupted: \"{err}\", ignored, continue polling"); | ||
|
||
| continue; | ||
| } | ||
| log::error!("Poll error: {}", err); | ||
| break; | ||
| } | ||
| for event in events.iter() { | ||
| event.token(); | ||
| loop { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This exit-code is important to help determine whether an environmental error has occurred. I must ask that it not be suppressed -- the changes here would replace it with
1.