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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.