mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
feat: Add connect timeout to TimeoutSettings (#158)
Because TcpSocket connects in Socket::new TimeoutSettings are now required for Socket::new. Since we already have TimeoutSettings there Sockets are now expected to apply timeout settings in Socket::new.
This commit is contained in:
parent
7416d54b14
commit
e3bdbc2a41
17 changed files with 97 additions and 42 deletions
|
|
@ -45,6 +45,7 @@ fn main() {
|
|||
let timeout_settings = TimeoutSettings::new(
|
||||
TimeoutSettings::default().get_read(),
|
||||
TimeoutSettings::default().get_write(),
|
||||
TimeoutSettings::default().get_connect(),
|
||||
2,
|
||||
)
|
||||
.unwrap();
|
||||
|
|
@ -90,6 +91,7 @@ mod test {
|
|||
fn test_game(game_name: &str) {
|
||||
let timeout_settings = Some(
|
||||
TimeoutSettings::new(
|
||||
Some(Duration::from_nanos(1)),
|
||||
Some(Duration::from_nanos(1)),
|
||||
Some(Duration::from_nanos(1)),
|
||||
0,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue