Skip to content

Commit

Permalink
Refactor examples (#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP authored Jan 6, 2025
1 parent 03f6446 commit 6ad3283
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 25 deletions.
3 changes: 0 additions & 3 deletions examples/src/main/java/io/zenoh/ZInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ public Integer call() throws Exception {
System.out.println("zid: " + info.zid());
System.out.println("routers zid: " + info.routersZid());
System.out.println("peers zid: " + info.peersZid());
} catch (ZError e) {
System.err.println("Error during Zenoh operation: " + e.getMessage());
return 1;
}
return 0;
}
Expand Down
4 changes: 0 additions & 4 deletions examples/src/main/java/io/zenoh/ZLiveliness.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ public Integer call() throws Exception {
while (true) {
Thread.sleep(1000);
}

} catch (ZError e) {
System.err.println("Error during Zenoh operation: " + e.getMessage());
return 1;
}
}

Expand Down
4 changes: 0 additions & 4 deletions examples/src/main/java/io/zenoh/ZPing.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ public Integer call() throws Exception {
long rtt = samples.get(i);
System.out.printf("%d bytes: seq=%d rtt=%dµs lat=%dµs%n", payloadSize, i, rtt, rtt / 2);
}
} catch (ZError e) {
System.err.println("Error: " + e.getMessage());
return 1;
}

return 0;
}

Expand Down
3 changes: 0 additions & 3 deletions examples/src/main/java/io/zenoh/ZPong.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public Integer call() throws Exception {
});

latch.await();
} catch (ZError e) {
System.err.println("Error: " + e.getMessage());
return 1;
}
return 0;
}
Expand Down
5 changes: 1 addition & 4 deletions examples/src/main/java/io/zenoh/ZPub.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
public class ZPub implements Callable<Integer> {

@Override
public Integer call() throws ZError {
public Integer call() throws ZError, InterruptedException {
Zenoh.initLogFromEnvOr("error");
Config config = loadConfig(emptyArgs, configFile, connect, listen, noMulticastScouting, mode);

Expand Down Expand Up @@ -72,9 +72,6 @@ public Integer call() throws ZError {
}
idx++;
}
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
return 1;
}
}

Expand Down
4 changes: 0 additions & 4 deletions examples/src/main/java/io/zenoh/ZPut.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ public Integer call() throws Exception {
} else {
session.put(keyExpr, ZBytes.from(value));
}
} catch (ZError e) {
System.err.println("Error during Zenoh operation: " + e.getMessage());
return 1;
}

return 0;
}

Expand Down
3 changes: 0 additions & 3 deletions examples/src/main/java/io/zenoh/ZSubThr.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ public Integer call() throws Exception {
Thread.sleep(1000);
}
}
} catch (ZError e) {
System.err.println("Error during Zenoh operation: " + e.getMessage());
return 1;
}
return 0;
}
Expand Down

0 comments on commit 6ad3283

Please sign in to comment.