Warning: msg_receive(): message corrupted in

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • carobee
    New Member
    • Jun 2007
    • 14

    #1

    Warning: msg_receive(): message corrupted in

    hi
    im trying to receive message from a C program to a php script. while receiving i have used non blocking flag in php. But when i try to read the message

    "Warning: msg_receive(): message corrupted " is displayed.

    i can see that the message from C prog is reaching the queue n its is picked up by
    php script.
    if i dont use the non blocking flag then i can view the message properly.

    This is the receiving part of my code

    [code=php]if ($res=msg_recei ve ($msg_id,2,$msg _type,100 , $msg,true, MSG_IPC_NOWAIT, $msg_err)){
    echo "</br>".($msg)."</br>";
    }[/code]

    [Please use CODE tags when posting source code. Thanks! --pbmods]
  • carobee
    New Member
    • Jun 2007
    • 14

    #2
    i got the ans change the serialise option to false

    [code=php]if ($res=msg_recei ve ($msg_id,2,$msg _type,100 , $msg,false, MSG_IPC_NOWAIT, $msg_err)){
    echo "</br>".($msg)."</br>";
    }[/code]

    Comment

    • Motoma
      Recognized Expert Specialist
      • Jan 2007
      • 3236

      #3
      Glad you were able to find your solution, thank you for posting it back for us to learn from.

      Comment

      Working...