forked from M-Labs/thermostat
main: wait for more tcp send headroom
This commit is contained in:
parent
10f7020c02
commit
a102e5fcec
|
@ -154,7 +154,7 @@ fn main() -> ! {
|
||||||
if ! socket.is_open() {
|
if ! socket.is_open() {
|
||||||
let _ = socket.listen(TCP_PORT);
|
let _ = socket.listen(TCP_PORT);
|
||||||
session.reset();
|
session.reset();
|
||||||
} else if socket.can_send() && socket.can_recv() && socket.send_capacity() - socket.send_queue() > 128 {
|
} else if socket.can_send() && socket.can_recv() && socket.send_capacity() - socket.send_queue() > 1024 {
|
||||||
match socket.recv(|buf| session.feed(buf)) {
|
match socket.recv(|buf| session.feed(buf)) {
|
||||||
Ok(SessionOutput::Nothing) => {}
|
Ok(SessionOutput::Nothing) => {}
|
||||||
Ok(SessionOutput::Command(command)) => match command {
|
Ok(SessionOutput::Command(command)) => match command {
|
||||||
|
|
Loading…
Reference in New Issue