Fix small things in LiveRecvModule

This commit is contained in:
2020-05-15 13:12:08 +02:00
parent 590ff5b625
commit 01d986c4f0
2 changed files with 82 additions and 68 deletions
+6 -2
View File
@@ -73,7 +73,9 @@ void LiveRecvModule::recv_single_module(
sizeof(ModuleFrame),
0);
if (n_bytes_metadata != sizeof(ModuleFrame)) {
if (n_bytes_metadata == -1) {
throw runtime_error(zmq_strerror(errno));
}else if (n_bytes_metadata != sizeof(ModuleFrame)) {
throw runtime_error("Stream header of wrong size.");
}
@@ -87,7 +89,9 @@ void LiveRecvModule::recv_single_module(
MODULE_N_BYTES,
0);
if (n_bytes_image != MODULE_N_BYTES) {
if (n_bytes_image == -1) {
throw runtime_error(zmq_strerror(errno));
} else if (n_bytes_image != MODULE_N_BYTES) {
throw runtime_error("Stream data of wrong size.");
}
}