P2PMessageQueue

Last post 03-15-2010 9:44 by sphauck. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-14-2010 11:03

    P2PMessageQueue

    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.

     

     

  • 03-15-2010 9:29 In reply to

    • ctacke
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-27-2007
    • Indiana
    • Posts 2,254

    Re: P2PMessageQueue

    Maybe put ProcessMessage into it's own worker thread so as to not block the receiving loop waiting for processing to complete?

  • 03-15-2010 9:44 In reply to

    Re: P2PMessageQueue

     I will give that a try and see what happens.

    Can you confirm that  _P2P_Inbound.Receive(msg); removes the message from the queue?

     

Page 1 of 1 (3 items)