Skip to Content
0

PCO Socket Connection- read message by length

Jul 20, 2017 at 08:39 AM

46

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

christian libich Jul 20, 2017 at 03:06 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jul 21, 2017 at 05:21 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded