mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 16:46:47 +00:00
Shmem: more detailed errors on meta data mismatch
This commit is contained in:
parent
a20ac7af08
commit
38eb9d22e4
|
@ -184,7 +184,10 @@ int Socket::Receive(MessagePtr& msg, const int timeout)
|
||||||
if (nbytes > 0) {
|
if (nbytes > 0) {
|
||||||
// check for number of received messages. must be 1
|
// check for number of received messages. must be 1
|
||||||
if (nbytes != sizeof(MetaHeader)) {
|
if (nbytes != sizeof(MetaHeader)) {
|
||||||
throw SocketError("Received message is not a valid FairMQ shared memory message. Possibly due to a misconfigured transport on the sender side.");
|
throw SocketError(
|
||||||
|
tools::ToString("Received message is not a valid FairMQ shared memory message. ",
|
||||||
|
"Possibly due to a misconfigured transport on the sender side. ",
|
||||||
|
"Expected size of ", sizeof(MetaHeader), " bytes, received ", nbytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
MetaHeader* hdr = static_cast<MetaHeader*>(zmqMsg.Data());
|
MetaHeader* hdr = static_cast<MetaHeader*>(zmqMsg.Data());
|
||||||
|
@ -302,7 +305,10 @@ int64_t Socket::Receive(vector<MessagePtr>& msgVec, const int timeout)
|
||||||
|
|
||||||
assert(hdrVecSize > 0);
|
assert(hdrVecSize > 0);
|
||||||
if (hdrVecSize % sizeof(MetaHeader) != 0) {
|
if (hdrVecSize % sizeof(MetaHeader) != 0) {
|
||||||
throw SocketError("Received message is not a valid FairMQ shared memory message. Possibly due to a misconfigured transport on the sender side.");
|
throw SocketError(
|
||||||
|
tools::ToString("Received message is not a valid FairMQ shared memory message. ",
|
||||||
|
"Possibly due to a misconfigured transport on the sender side. ",
|
||||||
|
"Expected size of ", sizeof(MetaHeader), " bytes, received ", nbytes));
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto numMessages = hdrVecSize / sizeof(MetaHeader);
|
const auto numMessages = hdrVecSize / sizeof(MetaHeader);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user