Created
January 3, 2015 00:04
-
-
Save XMPPwocky/cf09cacabb0ebc835652 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let len; | |
loop { | |
match socket.read(&mut buf) { | |
Ok(readlen) => { len = readlen; break; }, | |
Err(IoError { kind: TimedOut, .. }) => (), // busywait | |
Err(e) => panic!("Failed reading from socket: {}", e) | |
} | |
} | |
// len now contains the number of valid bytes in buf | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment