I am using the P2PMessageQueue and it seems to be working fine except......
I appear to be getting duplicates or they are not being removed from the queue when being read and the messages are backing up in the queue.
I am using the event like such
void _P2P_Inbound_DataOnQueueChanged(object sender, EventArgs e)
{
Message msg = new Message();
ReadWriteResult rwr = _P2P_Inbound.Receive(msg);
if (rwr == ReadWriteResult.OK)
{
ProcessMsg(msg.MessageBytes);
}
}
I am under the impression that when I execute this code _P2P_Inbound.Receive(msg); the message is pulled off the queue, is this correct?
How do I avoid the messages backing up in the queue, I am processing them in the event as soon as they arrive.
Any suggestions on how to use the queue more effeciently would be appreciated.