Jump to content

msg_receive question - garbage in message


crichard6069

Recommended Posts

Yes yes, I have another msg_receive question. I've solved my first problem (I'm apparently stupid today)..

 

I'm sending a message to the message queue from a process. PHP is reading the message out of the queue. The problem is, PHP will not always know the size of the message. It could be 10 bytes, or 50 bytes.. but it will be no more than, say, 100 bytes. With that said, I specify in PHP my max message size of 100. However, if the message in the queue is only a size of say, 15, the other 85 characters are showing up as garbage.

 

Is there a way to fix this? If I read the message back into C, C is smart enough to see the null terminator on the string. PHP doesn't seem smart enough to do this.. am I missing something?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/81351-msg_receive-question-garbage-in-message/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.