Log and print error for all examples

v0.7.x
Michal Podhradsky 2018-06-22 10:47:00 -07:00 committed by whitequark
parent 276acfb7ef
commit 3e124ef482
3 changed files with 20 additions and 3 deletions

View File

@ -108,7 +108,13 @@ fn main() {
let mut processed = 0; let mut processed = 0;
while !CLIENT_DONE.load(Ordering::SeqCst) { while !CLIENT_DONE.load(Ordering::SeqCst) {
let timestamp = Instant::now(); let timestamp = Instant::now();
iface.poll(&mut sockets, timestamp).expect("poll error"); match iface.poll(&mut sockets, timestamp) {
Ok(_) => {},
Err(e) => {
debug!("poll error: {}",e);
}
}
// tcp:1234: emit data // tcp:1234: emit data
{ {

View File

@ -66,7 +66,12 @@ fn main() {
loop { loop {
let timestamp = Instant::now(); let timestamp = Instant::now();
iface.poll(&mut sockets, timestamp).expect("poll error"); match iface.poll(&mut sockets, timestamp) {
Ok(_) => {},
Err(e) => {
debug!("poll error: {}",e);
}
}
{ {
let mut socket = sockets.get::<TcpSocket>(tcp_handle); let mut socket = sockets.get::<TcpSocket>(tcp_handle);

View File

@ -121,7 +121,13 @@ fn main() {
let ident = 0x22b; let ident = 0x22b;
loop { loop {
iface.poll(&mut sockets, Instant::now()).unwrap(); let timestamp = Instant::now();
match iface.poll(&mut sockets, timestamp) {
Ok(_) => {},
Err(e) => {
debug!("poll error: {}",e);
}
}
{ {
let timestamp = Instant::now(); let timestamp = Instant::now();