diff options
author | Stuart Stock <stuart@int08h.com> | 2018-03-10 18:56:53 -0600 |
---|---|---|
committer | Stuart Stock <stuart@int08h.com> | 2018-03-10 19:04:54 -0600 |
commit | f0417e609e50792fdba8147faa86b08bb2c4269d (patch) | |
tree | 541a998690ac3245334371f7ef2dc5890c3eb70d /Cargo.toml | |
parent | 8ea96f55379e6096026e8855ccdae699ca17c135 (diff) | |
download | roughenough-f0417e609e50792fdba8147faa86b08bb2c4269d.zip |
Read server socket until `WouldBlock`
Using the `-n` feature of @Aaron1011's excellent client I was able to
find and fix a nagging bug.
Post conversion from the hand-rolled event loop to a `mio` based one,
the server would intermittently fail to respond to client requests.
The server's UDP socket is edge-triggered and the `mio` docs clearly
state that [operations must be performed until `WouldBlock`](https://carllerche.github.io/mio/mio/struct.Poll.html#edge-triggered-and-level-triggered)
otherwise `poll` might not return subsequent events.
Fix is to loop inside the MESSAGE token match until `recv_from`
returns `WouldBlock`.
The resulting code is excessively nested; a cleanup will follow.
Diffstat (limited to 'Cargo.toml')
0 files changed, 0 insertions, 0 deletions