473,388 Members | 1,198 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

PHP message queue with perl?

AR
Hi,

Message queue problem. Perl program creates a message queue and send a
message to it. PHP program is to receive the message. Simple. But PHP's
msg_receive() is getting corrupted message. Can anyone tell me what is
wrong in the code?

Perl code
---------

#!/usr/bin/perl -w

use constant S_IRWXA => 0666;
use constant IPC_CREATE => 01000;

$key = 123456789;
$msgid = msgget($key, S_IRWXA | IPC_CREATE);

$type = 1;
$msg = "Hi PHP";
$data = pack("l! a*", $type, $msg);
msgsnd($msgid, $data, length($data) );
PHP code
--------

<?
$key = 123456789;
$qu = msg_get_queue($key);

$type = 1;
print "\nWaiting for message ...";
msg_receive ($qu, $type, $atyp, 1024, $data);
print "\nRecv data: " . $data;
?>
PHP code generates error like below -

Warning: msg_receive(): message corrupted in
<b>/var/www/embarque/test/intourist/msgq.php</b> on line <b>7</b>

Thanks in advance

AR

Jul 21 '05 #1
0 1700

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Bart Nessux | last post by:
How can one view the contents of a queue? I'd like to verify that the queue has the same number of objects as the list that has been put into it. Also, should one think of a queue as static or...
0
by: Gary | last post by:
I am planning to implement application to application communication using message queueing. I am using VB.NET on a Win2000 server OS with message queueing services enabled. I am find the...
0
by: dsclements | last post by:
>Description: I'm running mysql in a 3 server configuration, with 2 servers being slaves to the first. I'm running vpopmail, which means a connection every incoming mail and every check. I woke up...
8
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware...
6
by: les | last post by:
Here's a class which uses 2.0 generics to implement an inter-thread message queue in C#. Any number of threads can post and read from the queue simultaneously, and the message object can be any...
1
by: Andrew Robert | last post by:
Hi everyone, Could someone help explain what I am doing wrong in this code block? This code block is an excerpt from a larger file that receives transmitted files via IBM WebSphere MQSeries...
1
by: cgipro2007 | last post by:
Hello I have a perl script that sends an email letter (using sendmail program) to some number of email addresses. However, this mailing list is a little bit long (10,000+ emails) When the...
0
by: cgipro2007 | last post by:
Hello I have a perl script that sends an email letter (using sendmail program) to some number of email addresses. However, this mailing list is a little bit long (10,000+ emails) When the...
2
by: bernd | last post by:
Hi netties, posted this in a different group already, which seems to be inappropriate. I create a message queue with msgget(), sent a 5-byte message to it with msgsnd() and try to receive the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.