Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor examples #169

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading