Skip to content

Commit

Permalink
Log and print error for all examples
Browse files Browse the repository at this point in the history
  • Loading branch information
podhrmic authored and whitequark committed Jun 22, 2018
1 parent 682fc30 commit 4c7606d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
8 changes: 7 additions & 1 deletion examples/benchmark.rs
Expand Up @@ -108,7 +108,13 @@ fn main() {
let mut processed = 0;
while !CLIENT_DONE.load(Ordering::SeqCst) {
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
{
Expand Down
7 changes: 6 additions & 1 deletion examples/httpclient.rs
Expand Up @@ -66,7 +66,12 @@ fn main() {

loop {
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);
Expand Down
8 changes: 7 additions & 1 deletion examples/ping.rs
Expand Up @@ -121,7 +121,13 @@ fn main() {
let ident = 0x22b;

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();
Expand Down

0 comments on commit 4c7606d

Please sign in to comment.