2002-04-26 07:14:43 +08:00
|
|
|
--TEST--
|
2002-04-30 08:58:52 +08:00
|
|
|
send/receive serialized message.
|
2002-04-26 07:14:43 +08:00
|
|
|
--SKIPIF--
|
|
|
|
<?php // vim600:syn=php
|
|
|
|
if (!extension_loaded("sysvmsg")) print "skip"; ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2002-04-30 08:58:52 +08:00
|
|
|
$key = ftok("./ext/sysvmsg/tests/001.phpt", "p");
|
|
|
|
$q = msg_get_queue($key);
|
2002-04-26 07:14:43 +08:00
|
|
|
msg_send($q, 1, "hello") or print "FAIL\n";
|
|
|
|
$type = null;
|
2002-04-29 20:52:34 +08:00
|
|
|
if (msg_receive($q, 0, $type, 1024, $message)) {
|
2002-04-26 07:14:43 +08:00
|
|
|
echo "TYPE: $type\n";
|
2002-04-29 20:52:34 +08:00
|
|
|
echo "DATA: $message\n";
|
2002-04-26 07:14:43 +08:00
|
|
|
}
|
|
|
|
if (!msg_remove_queue($q)) {
|
|
|
|
echo "BAD: queue removal failed\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
|
|
|
TYPE: 1
|
|
|
|
DATA: hello
|