PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/manual/www.php.ru/manual/function.msg-receive.html

https://github.com/overchuk/vim
HTML | 653 lines | 473 code | 124 blank | 56 comment | 0 complexity | da90548dff160c2ea7694aa24a8fda61 MD5 | raw file
  1. <!--
  2. HTML dropped by Zend Guard Compressor 4.2
  3. php.ru team: mz, az, yuri, vb, cyxapuk, 440hz, administrator
  4. 2004-2007 (c) expi-web.com
  5. 2007-2008 (c) odware.com
  6. 0101-1010 (с) 440hz
  7. 2b|~2b=?
  8. -->
  9. <!-- EHOT тут всё пожрал ! -->
  10. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  11. <html>
  12. <head>
  13. <link rel="alternate" type="application/rss+xml" title="php.ru/forum - последние сообщения" href="http://www.php.ru/forum/rss.php">
  14. <link rel="SHORTCUT ICON" href="http://www.php.ru/favicon.ico" />
  15. <META name="description" content="php.ru - форум PHP программистов, поиск по всем ресурсам сети, посвященным php">
  16. <meta http-equiv="description" content="php.ru - форум PHP программистов, поиск по всем ресурсам сети, посвященным php">
  17. <META name="keywords" content="php, php5, apache, mysql, session">
  18. <meta http-equiv="keywords" content="php, php5, apache, mysql, session">
  19. <title>php.ru - msg_receive</title>
  20. <LINK REL="stylesheet" TYPE="text/css" HREF="http://www.php.ru/index.css">
  21. <script language="JavaScript" src="http://www.php.ru/ajax/ajax.js"></script>
  22. </head>
  23. <body>
  24. <table height='100%' width='100%' cellspacing='0' cellpadding='0'>
  25. <tr height='99%' valign='top'>
  26. <td align='center'>
  27. <table style='margin-top: 4px' width=100% cellspacing=0 cellpadding=3>
  28. <tr>
  29. <td>PHP - <a href="http://ru.wikipedia.org/wiki/%D0%A0%D0%B5%D0%BA%D1%83%D1%80%D1%81%D0%B8%D0%B2%D0%BD%D1%8B%D0%B9_%D0%B0%D0%BA%D1%80%D0%BE%D0%BD%D0%B8%D0%BC" target=_blank class=lnk>рекурсивный акроним</a> словосочетания &laquo;<a href="/manual/introduction.html" class=lnk>PHP: Hypertext Preprocessor</a>&raquo;</td>
  30. </tr>
  31. </table>
  32. <script language="JavaScript" src="http://www.php.ru/ajax/subsys_ajax.js"></script>
  33. <!--
  34. commet by 440hz
  35. 20.10.2007
  36. <script language="JavaScript" src="http://www.php.ru/ajax/pu_search.js"></script>
  37. -->
  38. <script language="JavaScript" src="http://www.php.ru/ajax/cz.js?a=b"></script>
  39. <table style='margin-top: 5px' width=100% bgcolor=#9999cc cellspacing=0 cellpadding=0 border=0>
  40. <form name=SEARCH method=GET action="http://www.php.ru/search/?SID=uh0qurxoqgdzizap" onsubmit="return puSubmit();">
  41. <input type=hidden name=PAGE value=1>
  42. <tr>
  43. <td width='1' valign='middle'>
  44. <a href='/'><img src="http://www.php.ru/;-)/logo.gif" width=133 height=93 alt="php" border=0 hspace=10 vspace=0></a>
  45. </td>
  46. <td width='100%' valign='middle'>
  47. <!--
  48. commet by 440hz
  49. 20.10.2007
  50. <div id='pu_search' class='pu_search'></div>
  51. <div id='pu_search_description' class='pu_search_decription'></div>
  52. -->
  53. <input type=text style='width:99%; margin: 10px' maxlength='200' name='QS' class='in' id='query' autocomplete='off' value="" />
  54. </td>
  55. </tr>
  56. <tr bgcolor='#666699' valign='middle'>
  57. <td style='border-top: 1px solid #333366;'><br /></td>
  58. <td style='border-top: 1px solid #333366;'><div style="padding: 4px 4px 4px 10px; height: 24px; color: #CCCCFF;" id="stat">Хто там?<script>doLoadCZ('stat','stat');</script></div></td>
  59. </tr>
  60. </form>
  61. </table>
  62. <table id="menu" cellspaciong=0 cellpadding=3>
  63. <tr>
  64. <td><a href="/" class=current>Главная</a></td>
  65. <td><a href="/download/" class=current>Скачать</a></td>
  66. <td><a href="/doc/" class=current>Документация</a></td>
  67. <td><a href="/forum/" class=current>Форум</a></td>
  68. <td width=100% align=right><a href="/phpinfo.html" class=current>phpinfo()</a></td>
  69. </tr>
  70. </table>
  71. <!-- AdRiver code START. Type:728x90 Site: php.ru PZ: 0 BN: 1 -->
  72. <script language="javascript" type="text/javascript"><!--
  73. var RndNum4NoCash = Math.round(Math.random() * 1000000000);
  74. var ar_Tail='unknown'; if (document.referrer) ar_Tail = escape(document.referrer);
  75. document.write(
  76. '<iframe src="http://ad.adriver.ru/cgi-bin/erle.cgi?'
  77. + 'sid=148680&bn=1&target=blank&bt=36&pz=0&rnd=' + RndNum4NoCash + '&tail256=' + ar_Tail
  78. + '" frameborder=0 vspace=0 hspace=0 width=728 height=90 marginwidth=0'
  79. + ' marginheight=0 scrolling=no></iframe>');
  80. //--></script>
  81. <noscript>
  82. <a href="http://ad.adriver.ru/cgi-bin/click.cgi?sid=148680&bn=1&bt=36&pz=0&rnd=1525626915" target=_blank>
  83. <img src="http://ad.adriver.ru/cgi-bin/rle.cgi?sid=148680&bn=1&bt=36&pz=0&rnd=1525626915" alt="-AdRiver-" border=0 width=728 height=90></a>
  84. </noscript>
  85. <!-- AdRiver code END -->
  86. <table width='100%' cellspacing='0' cellpadding='0'>
  87. <tr valign='top'>
  88. <td width=100%><div style="margin: 10px 10px 10px 50px;"><center><div style="width: 800px; text-align: left"><DIV
  89. CLASS="NAVHEADER"
  90. ><TABLE
  91. SUMMARY="Header navigation table"
  92. WIDTH="100%"
  93. BORDER="0"
  94. CELLPADDING="0"
  95. CELLSPACING="0"
  96. ><TR
  97. ><TH
  98. COLSPAN="3"
  99. ALIGN="center"
  100. >Руководство по PHP</TH
  101. ></TR
  102. ><TR
  103. ><TD
  104. WIDTH="10%"
  105. ALIGN="left"
  106. VALIGN="bottom"
  107. ><A
  108. HREF="function.msg-get-queue.html"
  109. ACCESSKEY="P"
  110. >Пред.</A
  111. ></TD
  112. ><TD
  113. WIDTH="80%"
  114. ALIGN="center"
  115. VALIGN="bottom"
  116. ></TD
  117. ><TD
  118. WIDTH="10%"
  119. ALIGN="right"
  120. VALIGN="bottom"
  121. ><A
  122. HREF="function.msg-remove-queue.html"
  123. ACCESSKEY="N"
  124. >След.</A
  125. ></TD
  126. ></TR
  127. ></TABLE
  128. ><HR
  129. ALIGN="LEFT"
  130. WIDTH="100%"></DIV
  131. ><H1
  132. ><A
  133. NAME="function.msg-receive"
  134. ></A
  135. >msg_receive</H1
  136. ><DIV
  137. CLASS="refnamediv"
  138. ><A
  139. NAME="AEN163695"
  140. ></A
  141. ><P
  142. > (PHP 4 &#62;= 4.3.0, PHP 5)</P
  143. >msg_receive&nbsp;--&nbsp;
  144. Receive a message from a message queue
  145. </DIV
  146. ><DIV
  147. CLASS="refsect1"
  148. ><A
  149. NAME="AEN163698"
  150. ></A
  151. ><H2
  152. >Description</H2
  153. >bool <B
  154. CLASS="methodname"
  155. >msg_receive</B
  156. > ( resource queue, int desiredmsgtype, int &#38;msgtype, int maxsize, mixed &#38;message [, bool unserialize [, int flags [, int &#38;errorcode]]] )<BR
  157. ></BR
  158. ><P
  159. >&#13; <B
  160. CLASS="function"
  161. >msg_receive()</B
  162. > will receive the first message from the
  163. specified <VAR
  164. CLASS="parameter"
  165. >queue</VAR
  166. > of the type specified by
  167. <VAR
  168. CLASS="parameter"
  169. >desiredmsgtype</VAR
  170. >.
  171. The type of the message that was received will be stored in
  172. <VAR
  173. CLASS="parameter"
  174. >msgtype</VAR
  175. >.
  176. The maximum size of message to be accepted is specified by the
  177. <VAR
  178. CLASS="parameter"
  179. >maxsize</VAR
  180. >; if the message in the queue is larger
  181. than this size the function will fail (unless you set
  182. <VAR
  183. CLASS="parameter"
  184. >flags</VAR
  185. > as described below).
  186. The received message will be stored in <VAR
  187. CLASS="parameter"
  188. >message</VAR
  189. >,
  190. unless there were errors receiving the message, in which case the
  191. optional <VAR
  192. CLASS="parameter"
  193. >errorcode</VAR
  194. > will be set to the value of the
  195. system errno variable to help you identify the cause.
  196. </P
  197. ><P
  198. >&#13; If <VAR
  199. CLASS="parameter"
  200. >desiredmsgtype</VAR
  201. > is 0, the message from the front
  202. of the queue is returned. If <VAR
  203. CLASS="parameter"
  204. >desiredmsgtype</VAR
  205. > is
  206. greater than 0, then the first message of that type is returned.
  207. If <VAR
  208. CLASS="parameter"
  209. >desiredmsgtype</VAR
  210. > is less than 0, the first
  211. message on the queue with the lowest type less than or equal to the
  212. absolute value of <VAR
  213. CLASS="parameter"
  214. >desiredmsgtype</VAR
  215. > will be read.
  216. If no messages match the criteria, your script will wait until a suitable
  217. message arrives on the queue. You can prevent the script from blocking
  218. by specifying <TT
  219. CLASS="constant"
  220. ><B
  221. >MSG_IPC_NOWAIT</B
  222. ></TT
  223. > in the
  224. <VAR
  225. CLASS="parameter"
  226. >flags</VAR
  227. > parameter.
  228. </P
  229. ><P
  230. >&#13; <VAR
  231. CLASS="parameter"
  232. >unserialize</VAR
  233. > defaults to <TT
  234. CLASS="constant"
  235. ><B
  236. >TRUE</B
  237. ></TT
  238. >; if it is set to
  239. <TT
  240. CLASS="constant"
  241. ><B
  242. >TRUE</B
  243. ></TT
  244. >, the message is treated as though it was serialized using the same
  245. mechanism as the session module. The message will be unserialized and
  246. then returned to your script. This allows you to easily receive arrays
  247. or complex object structures from other PHP scripts, or if you are using
  248. the WDDX serializer, from any WDDX compatible source.
  249. If <VAR
  250. CLASS="parameter"
  251. >unserialize</VAR
  252. > is <TT
  253. CLASS="constant"
  254. ><B
  255. >FALSE</B
  256. ></TT
  257. >, the message will be
  258. returned as a binary-safe string.
  259. </P
  260. ><P
  261. >&#13; The optional <VAR
  262. CLASS="parameter"
  263. >flags</VAR
  264. > allows you to pass flags to the
  265. low-level msgrcv system call. It defaults to 0, but you may specify one
  266. or more of the following values (by adding or ORing them together).
  267. <DIV
  268. CLASS="table"
  269. ><A
  270. NAME="AEN163751"
  271. ></A
  272. ><P
  273. ><B
  274. >Таблица 1. Flag values for msg_receive</B
  275. ></P
  276. ><TABLE
  277. BORDER="1"
  278. CLASS="CALSTABLE"
  279. ><COL><COL><TBODY
  280. ><TR
  281. ><TD
  282. ><TT
  283. CLASS="constant"
  284. ><B
  285. >MSG_IPC_NOWAIT</B
  286. ></TT
  287. ></TD
  288. ><TD
  289. >If there are no messages of the
  290. <VAR
  291. CLASS="parameter"
  292. >desiredmsgtype</VAR
  293. >, return immediately and do not
  294. wait. The function will fail and return an integer value
  295. corresponding to ENOMSG.
  296. </TD
  297. ></TR
  298. ><TR
  299. ><TD
  300. ><TT
  301. CLASS="constant"
  302. ><B
  303. >MSG_EXCEPT</B
  304. ></TT
  305. ></TD
  306. ><TD
  307. >Using this flag in combination with a
  308. <VAR
  309. CLASS="parameter"
  310. >desiredmsgtype</VAR
  311. > greater than 0 will cause the
  312. function to receive the first message that is not equal to
  313. <VAR
  314. CLASS="parameter"
  315. >desiredmsgtype</VAR
  316. >.</TD
  317. ></TR
  318. ><TR
  319. ><TD
  320. ><TT
  321. CLASS="constant"
  322. ><B
  323. >MSG_NOERROR</B
  324. ></TT
  325. ></TD
  326. ><TD
  327. >&#13; If the message is longer than <VAR
  328. CLASS="parameter"
  329. >maxsize</VAR
  330. >,
  331. setting this flag will truncate the message to
  332. <VAR
  333. CLASS="parameter"
  334. >maxsize</VAR
  335. > and will not signal an error.
  336. </TD
  337. ></TR
  338. ></TBODY
  339. ></TABLE
  340. ></DIV
  341. >
  342. </P
  343. ><P
  344. >&#13; Upon successful completion the message queue data structure is updated as
  345. follows: <VAR
  346. CLASS="literal"
  347. >msg_lrpid</VAR
  348. > is set to the process-ID of the
  349. calling process, <VAR
  350. CLASS="literal"
  351. >msg_qnum</VAR
  352. > is decremented by 1 and
  353. <VAR
  354. CLASS="literal"
  355. >msg_rtime</VAR
  356. > is set to the current time.
  357. </P
  358. ><P
  359. >&#13; <B
  360. CLASS="function"
  361. >msg_receive()</B
  362. > returns <TT
  363. CLASS="constant"
  364. ><B
  365. >TRUE</B
  366. ></TT
  367. > on success or <TT
  368. CLASS="constant"
  369. ><B
  370. >FALSE</B
  371. ></TT
  372. > on
  373. failure. If the function fails, the optional
  374. <VAR
  375. CLASS="parameter"
  376. >errorcode</VAR
  377. > will be set to the value of the system
  378. errno variable.
  379. </P
  380. ><P
  381. >&#13; See also <A
  382. HREF="function.msg-remove-queue.html"
  383. ><B
  384. CLASS="function"
  385. >msg_remove_queue()</B
  386. ></A
  387. >,
  388. <A
  389. HREF="function.msg-send.html"
  390. ><B
  391. CLASS="function"
  392. >msg_send()</B
  393. ></A
  394. >,
  395. <A
  396. HREF="function.msg-stat-queue.html"
  397. ><B
  398. CLASS="function"
  399. >msg_stat_queue()</B
  400. ></A
  401. > and
  402. <A
  403. HREF="function.msg-set-queue.html"
  404. ><B
  405. CLASS="function"
  406. >msg_set_queue()</B
  407. ></A
  408. >.
  409. </P
  410. ></DIV
  411. ><DIV
  412. CLASS="NAVFOOTER"
  413. ><HR
  414. ALIGN="LEFT"
  415. WIDTH="100%"><TABLE
  416. SUMMARY="Footer navigation table"
  417. WIDTH="100%"
  418. BORDER="0"
  419. CELLPADDING="0"
  420. CELLSPACING="0"
  421. ><TR
  422. ><TD
  423. WIDTH="33%"
  424. ALIGN="left"
  425. VALIGN="top"
  426. ><A
  427. HREF="function.msg-get-queue.html"
  428. ACCESSKEY="P"
  429. >Пред.</A
  430. ></TD
  431. ><TD
  432. WIDTH="34%"
  433. ALIGN="center"
  434. VALIGN="top"
  435. ><A
  436. HREF="index.html"
  437. ACCESSKEY="H"
  438. >Начало</A
  439. ></TD
  440. ><TD
  441. WIDTH="33%"
  442. ALIGN="right"
  443. VALIGN="top"
  444. ><A
  445. HREF="function.msg-remove-queue.html"
  446. ACCESSKEY="N"
  447. >След.</A
  448. ></TD
  449. ></TR
  450. ><TR
  451. ><TD
  452. WIDTH="33%"
  453. ALIGN="left"
  454. VALIGN="top"
  455. >msg_get_queue</TD
  456. ><TD
  457. WIDTH="34%"
  458. ALIGN="center"
  459. VALIGN="top"
  460. ><A
  461. HREF="ref.sem.html"
  462. ACCESSKEY="U"
  463. >Уровень выше</A
  464. ></TD
  465. ><TD
  466. WIDTH="33%"
  467. ALIGN="right"
  468. VALIGN="top"
  469. >msg_remove_queue</TD
  470. ></TR
  471. ></TABLE
  472. ></DIV
  473. ></div></center></div></td>
  474. <td><div style="display:none; width:200px;" id="o3" name="o3"><script charset="windows-1251" type="text/javascript" src="http://www.ozon.ru/PartnerTwinerNew.aspx?revident=bea9126b-c8e1-4bf5-b6d8-9a057f8feac6" ></script></div><script>o = document.getElementById('o3'); if(o) { var s = o.innerHTML; s = s.replace(/F6F6F6/gi,"FFFFFF"); o.innerHTML = s.replace(/padding-top: 10px; padding-bottom: 10px;/,"display:none;"); o.style.display = 'block'; } </script><br><div style="margin: 10px;"><script type="text/javascript"><!--
  475. google_ad_client = "pub-4093271809023514";
  476. /* 120x600, создано 01.11.2008 */
  477. google_ad_slot = "0438855731";
  478. google_ad_width = 120;
  479. google_ad_height = 600;
  480. //-->
  481. </script>
  482. <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div></td>
  483. </tr>
  484. </table>
  485. </td>
  486. </tr>
  487. <tr valign='bottom' height='1%'>
  488. <td> <table width=100% cellspacing=0 cellpadding=5 border=0 bgcolor=#9999CC>
  489. <tr valign=center>
  490. <td class='phpcopyright' width='45%' align='left'>&nbsp;&nbsp;Engine <a href="http://www.mnogosearch.org/">MnoGoSearch</a></td>
  491. <td class='phpcopyright' width='10%' align='center'>2007-2010 &copy <a href="mailto:webmaster@php.ru">PHP.RU</a></td>
  492. <td class='phpcopyright' width='45%' align='right' >Powered by <a target="_blank" href="http://odware.ru">ODware</a> <a HREF="http://440hz.ru">440Hz</a> &nbsp;&nbsp;</td>
  493. </tr>
  494. </table>
  495. <div style="text-align: right; padding: 5px">
  496. <!--LiveInternet counter-->
  497. <script type="text/javascript">document.write('<a href="http://www.liveinternet.ru/click" target=_blank><img src="http://counter.yadro.ru/hit?t53.6;r' + escape(document.referrer) + ((typeof(screen)=='undefined')?'':';s'+screen.width+'*'+screen.height+'*'+(screen.colorDepth?screen.colorDepth:screen.pixelDepth)) + ';u' + escape(document.URL) +';i' + escape('Жж'+document.title.substring(0,80)) + ';' + Math.random() + '" border=0 width=88 height=31 alt="" title="LiveInternet: показано число просмотров и посетителей за 24 часа"><\/a>');
  498. </script>
  499. <!--/LiveInternet-->
  500. <!-- SpyLOG -->
  501. <script src="http://tools.spylog.ru/counter2.2.js" type="text/javascript" id="spylog_code" counter="830950" ></script>
  502. <noscript><a href="http://u8309.50.spylog.com/cnt?cid=830950&f=3&p=0" target="_blank"><img src="http://u8309.50.spylog.com/cnt?cid=830950&p=0&f=4" alt='SpyLOG' border='0' width=88 height=31 ></a>
  503. </noscript>
  504. <!--/ SpyLOG -->
  505. </div>
  506. </td>
  507. </tr>
  508. </table>
  509. <script>
  510. <!--
  511. document.SEARCH.QS.focus();
  512. // --></script>
  513. <!--
  514. как же вы все это читаете?
  515. 440hz
  516. -->
  517. </body>
  518. </html>