Skip to Content
avatar image
Former Member

PCO Socket Connection- read message by length

Hi Folks,

This is regarding the Pco Socket connection in MII. While configuring the socket we need to specify either Terminator character or message length. I have specified the terminator character (\n) but client is having a concern that this character can appear in between of messages. They are asking to use length to read the message. As you can see in the attached screen shot I have configured 2 ports (there are many ports). In case I want to specify the length to read the message I think all the messages from that port need to respect that length. In our scenario we have many messages from one port number with different length. What configuration I have to do in order to read different messages with different length from a port number.

Thanks

Shaji

pcoss.png

pcoss.png (62.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 20, 2017 at 03:06 PM

    It really depends on what your messages look like but in the past I have dealt with this by buffering partial message chunks pushed by PCo in a Queue or db on the MII side. You just need to be able to discern when you have a complete message in your buffer with MII logic.

    Regards,
    Christian

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 21, 2017 at 05:21 AM

    Hi Christian,

    Thanks for your quick response.

    As per my knowledge if we specify a particular message length (for Example 1000) Pco will read only those messages which are coming with length 1000. I mean to say if there is a message with length as 999 or 1001 I think Pco will not read it. In this case I can't push the message to Queue or DB as you mentioned.

    Please correct me if I am wrong

    Thanks

    Shaji

    Add comment
    10|10000 characters needed characters exceeded