Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #7514
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!telefonica.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | "M. Strobel" <sorry_no_mail_here@nowhere.dee> |
| Newsgroups | comp.lang.php |
| Subject | Re: Message queues not working properly PHP -> C |
| Date | Sat, 10 Nov 2012 17:57:08 +0100 |
| Lines | 52 |
| Message-ID | <ag7fb4FdrhqU1@mid.uni-berlin.de> (permalink) |
| References | <509d702d$0$773$58c7af7e@news.kabelfoon.nl> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de dAB4oeunrTkiR8ckRNpe1gzBVgjNNQ03OmlToRPGZy3FGkQwChTndgvj58wWLULhk= |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2 |
| In-Reply-To | <509d702d$0$773$58c7af7e@news.kabelfoon.nl> |
| Xref | csiph.com comp.lang.php:7514 |
Show key headers only | View raw
Am 09.11.2012 22:05, schrieb Muffinman:
> Hello all,
>
> I've got a php script that needs to send out some info to a c script
> (already running). Somehow when php sends out through a message queue it
> looks like it copies the previous message (send by php or c) and copies
> it's own message over it with the previous message still visible if it
> is longer than the next php message. No messages are lost though, only
> copied and overwritten.
>
> So see below the terminal output. First we send three time "Hi" (the
> quotes are added by the c app). Then three time "Hai hai" and the last
> time "Hi".
>
> Adding \r, \n or \n\r does not help
>
> Can someone tell me what's going wrong here? Communication between php
> -> php goes without error, same goes for c -> c and c -> php. But php ->
> c not.
>
> The php script is copied below.
>
> Thanks in advance, Maarten
>
> key is 1107375495
> spock: ready to receive messages, captain. msqid = 196612
> spock: "Hi"
> spock: "Hi"
> spock: "Hi"
> spock: "Hai hai"
> spock: "Hai hai"
> spock: "Hai hai"
> spock: "Hii hai"
>
> ************************
> <?php
> $MSGKEY = ftok ('/Users/Maarten/test.test' , 'B') ;
>
>
> $msg_id = msg_get_queue ($MSGKEY, 0666);
> print_r ($msg_id);
>
> if (!msg_send ($msg_id, 1, "Quit", false, true, $msg_err))
> echo "Msg not sent because\n";
> ?>
> *********************
>
Do a 'cat /proc/sys/fs/mqueue/msg_max', it shows 10 on my system. Maybe your queue is
full. See the manual on msg_get_queue().
/Str.
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Message queues not working properly PHP -> C Muffinman <news**REMOVETHIS**@koster.tk> - 2012-11-09 22:05 +0100
Re: Message queues not working properly PHP -> C "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-11-10 17:57 +0100
Re: Message queues not working properly PHP -> C Muffinman <news**REMOVETHIS**@koster.tk> - 2012-11-11 15:41 +0100
Re: Message queues not working properly PHP -> C Muffinman <news**REMOVETHIS**@koster.tk> - 2012-11-11 15:57 +0100
Re: Message queues not working properly PHP -> C Jerry Stuckle <jstucklex@attglobal.net> - 2012-11-11 14:01 -0500
csiph-web