国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術(shù)|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務(wù)器之家 - 編程語言 - PHP教程 - PHP的消息通信機制測試實例

PHP的消息通信機制測試實例

2021-03-22 18:19flandycheng PHP教程

這篇文章主要介紹了PHP的消息通信機制,結(jié)合實例形式分析了php消息通信的信息發(fā)送與獲取相關(guān)操作技巧,需要的朋友可以參考下

本文實例講述了PHP的消息通信機制。分享給大家供大家參考,具體如下:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php error_reporting(E_ALL&~E_WARNING&~E_NOTICE);
/**
 * Example for sending and receiving Messages via the System V Message Queue
 *
 * To try this script run it synchron/asynchron twice times. One time with ?type=send and one time with ?type=receive
 *
 * @author     Thomas Eimers - Mehrkanal GmbH
 *
 * This document is distributed in the hope that it will be useful, but without any warranty;
 * without even the implied warranty of merchantability or fitness for a particular purpose.
 */
ob_implicit_flush(1);
header('Content-Type: text/plain; charset=ISO-8859-1');
echo "Start...\n";
// Create System V Message Queue. Integer value is the number of the Queue
//$queue = msg_get_queue(100379);
$mesg_key = ftok(__FILE__, 'm');
$mesg_id = msg_get_queue($mesg_key, 0666);
$queue = $mesg_id;
// Sendoptions
$serialize_needed=false; // Must the transfer data be serialized ?
$block_send=false;    // Block if Message could not be send (Queue full...) (true/false)
$msgtype_send=1;     // Any Integer above 0. It signeds every Message. So you could handle multible message
             // type in one Queue.
// Receiveoptions
$msgtype_receive=1;    // Whiche type of Message we want to receive ? (Here, the type is the same as the type we send,
             // but if you set this to 0 you receive the next Message in the Queue with any type.
$maxsize=100;       // How long is the maximal data you like to receive.
$option_receive=MSG_IPC_NOWAIT; // If there are no messages of the wanted type in the Queue continue without wating.
             // If is set to NULL wait for a Message.
// Send or receive 20 Messages
for ($i=0;$i<20;$i++) {
   sleep(1);
  ob_flush();
  flush();
 $message='Hello, This is Flandy,now is '.date("H:i:s",time());   // Transfering Data
 // This one sends
  if (isset($_GET['type'])&&$_GET['type']=='send') {
  if(msg_send($queue,$msgtype_send, $message,$serialize_needed, $block_send,$err)===true) {
   echo "The ".$i." Message has been sent, the messge is ".$message."\n";
  } else {
   var_dump($err);
  }
 // This one received
 } else {
   $queue_status=msg_stat_queue($queue);
   echo 'Get Messages in the queue: '.$queue_status['msg_qnum']."\n";
   print_r($queue_status);
   echo "\n";
  if ($queue_status['msg_qnum']>0) {
   if (msg_receive($queue,$msgtype_receive ,$msgtype_erhalten,$maxsize,$daten,$serialize_needed, $option_receive, $err)===true) {
       echo "Received data:".$daten."\n";
   } else {
       var_dump($err);
   }
  }
 }
}
?>

希望本文所述對大家PHP程序設(shè)計有所幫助。

延伸 · 閱讀

精彩推薦
Weibo Article 1 Weibo Article 2 Weibo Article 3 Weibo Article 4 Weibo Article 5 Weibo Article 6 Weibo Article 7 Weibo Article 8 Weibo Article 9 Weibo Article 10 Weibo Article 11 Weibo Article 12 Weibo Article 13 Weibo Article 14 Weibo Article 15 Weibo Article 16 Weibo Article 17 Weibo Article 18 Weibo Article 19 Weibo Article 20 Weibo Article 21 Weibo Article 22 Weibo Article 23 Weibo Article 24 Weibo Article 25 Weibo Article 26 Weibo Article 27 Weibo Article 28 Weibo Article 29 Weibo Article 30 Weibo Article 31 Weibo Article 32 Weibo Article 33 Weibo Article 34 Weibo Article 35 Weibo Article 36 Weibo Article 37 Weibo Article 38 Weibo Article 39 Weibo Article 40
主站蜘蛛池模板: 精品一区二区久久久久久久网站 | 欧美日本一区二区三区 | 奇米av在线 | 一区二区三区国产 | 日韩中文字幕视频在线观看 | 99re视频在线观看 | 亚洲成人精品在线观看 | 午夜视频一区二区三区 | 亚洲欧美精品 | 毛片免费播放 | 国产精品视频久久久 | 亚洲视频在线一区 | 老女肥熟av免费观看 | 999久久久国产999久久久 | 成人免费观看49www在线观看 | 日韩五码| 欧美激情视频一区二区三区在线播放 | 国偷自产一区二区免费视频 | 一区二区在线视频 | 在线观看黄色电影 | 国产精品99久久久久久久vr | 久久国产精品免费一区二区三区 | 在线四区 | 国产欧美日韩免费 | 91精品国产高清久久久久久久久 | 国产精品久久久久久久午夜片 | 夜夜操比 | 中文字幕在线观看精品视频 | 国产99精品 | 亚洲天堂中文字幕 | 欧美精品三区 | 曰本人一级毛片免费完整视频 | 一区二区乱码 | 成人h视频在线观看 | 韩日一区二区 | 日本免费精品视频 | 亚洲 欧美 国产 制服 动漫 | 国产成人精品免费 | 亚洲午夜电影 | 国产一区二区三区久久久久久久久 | 免费三片在线观看网站 |