Set write timeout
No read timeout because who knows if we'll ever receive a packet, but writes shouldn't last long
This commit is contained in:
parent
cfa763ffc4
commit
3c0590b273
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
use std::{
|
use std::{
|
||||||
io::Result,
|
io::Result,
|
||||||
net::{Ipv6Addr, UdpSocket},
|
net::{Ipv6Addr, UdpSocket},
|
||||||
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crossbeam_channel::unbounded;
|
use crossbeam_channel::unbounded;
|
||||||
|
@ -12,7 +13,7 @@ use super::{
|
||||||
|
|
||||||
fn configure_socket(socket: &UdpSocket) -> Result<()> {
|
fn configure_socket(socket: &UdpSocket) -> Result<()> {
|
||||||
socket.set_read_timeout(None)?;
|
socket.set_read_timeout(None)?;
|
||||||
socket.set_write_timeout(None)?;
|
socket.set_write_timeout(Some(Duration::from_secs(1)))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue