我使用 msgrcv 函数从信件队列中读取消息。 当我读取已知的长度数据时, 效果很好。 有些情况下, 我的信件长度是可变的。 在这样的情况下, 我如何分配仅需要多少内存, 从信件队列中读取消息而不丢失任何信件队列中的数据 。 请给一个想法来克服这个问题 。
Note: In IBM message queue, when we read exceeded length data, it fills the actual size of the message into structure which we are passing mqget function. Like this, Is there any way to do this operation in message queue.