now fixed properly
This commit is contained in:
parent
cbeb78f089
commit
9ee1bd15c4
@ -86,3 +86,7 @@ size_t MessageQueueMessage::getMaximumMessageSize() const {
|
||||
return this->MAX_MESSAGE_SIZE;
|
||||
}
|
||||
|
||||
size_t MessageQueueMessage::getMaximumDataSize() const {
|
||||
return this->MAX_DATA_SIZE;
|
||||
}
|
||||
|
||||
|
@ -139,6 +139,7 @@ public:
|
||||
virtual void setMessageSize(size_t messageSize) override;
|
||||
virtual size_t getMinimumMessageSize() const override;
|
||||
virtual size_t getMaximumMessageSize() const override;
|
||||
virtual size_t getMaximumDataSize() const override;
|
||||
|
||||
/**
|
||||
* @brief This is a debug method that prints the content.
|
||||
|
@ -72,6 +72,7 @@ public:
|
||||
virtual void setMessageSize(size_t messageSize) = 0;
|
||||
virtual size_t getMinimumMessageSize() const = 0;
|
||||
virtual size_t getMaximumMessageSize() const = 0;
|
||||
virtual size_t getMaximumDataSize() const = 0;
|
||||
|
||||
};
|
||||
|
||||
|
@ -191,13 +191,14 @@ ReturnValue_t MessageQueue::receiveMessage(MessageQueueMessageIF* message) {
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
else if(status==0) {
|
||||
else if (status==0) {
|
||||
//Success but no message received
|
||||
return MessageQueueIF::EMPTY;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
//No message was received. Keep lastPartner anyway, I might send
|
||||
//something later. But still, delete packet content.
|
||||
memset(message->getBuffer(), 0, message->getMaximumMessageSize());
|
||||
memset(message->getData(), 0, message->getMaximumDataSize());
|
||||
switch(errno){
|
||||
case EAGAIN:
|
||||
//O_NONBLOCK or MQ_NONBLOCK was set and there are no messages
|
||||
|
Loading…
Reference in New Issue
Block a user