mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-27 20:28:25 +08:00
firmware: Disable the Nagle algorithm on sockets
Signed-off-by: Michael Birtwell <michael.birtwell@oxionics.com>
This commit is contained in:
parent
bca30becbf
commit
82505a2203
@ -402,16 +402,18 @@ impl<'a> TcpListener<'a> {
|
|||||||
socket.may_send() || socket.may_recv()
|
socket.may_send() || socket.may_recv()
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let accepted = self.handle.get();
|
let accepted = TcpStream {
|
||||||
|
io: self.io,
|
||||||
|
handle: self.handle.get(),
|
||||||
|
};
|
||||||
|
accepted.with_lower(|s| s.set_nagle_enabled(false));
|
||||||
|
|
||||||
self.handle.set(Self::new_lower(self.io, self.buffer_size.get()));
|
self.handle.set(Self::new_lower(self.io, self.buffer_size.get()));
|
||||||
match self.listen(self.endpoint.get()) {
|
match self.listen(self.endpoint.get()) {
|
||||||
Ok(()) => (),
|
Ok(()) => (),
|
||||||
_ => unreachable!()
|
_ => unreachable!()
|
||||||
}
|
}
|
||||||
Ok(TcpStream {
|
Ok(accepted)
|
||||||
io: self.io,
|
|
||||||
handle: accepted
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn close(&self) {
|
pub fn close(&self) {
|
||||||
|
Loading…
Reference in New Issue
Block a user