You could have a daemon that creates a long-lived jabber connection, then listens on [local IPC mechanism of your choice].
As Craig and I proved to ourselves one day, there are at *least* 20 ways to do that. Here are a couple: - TCP socket - Named pipe - Shared mem - SysV ipc queue I'd recommend using JECL, and using the SocketPool to listen for connections locally. Jan Fabry <[EMAIL PROTECTED]> writes: > Hello, > > I'll try to explain my idea, but feel free to ask questions if > anything is unclear! > > I was thinking about some sort of 'client deamon' for Jabber. The > situation I'm confronted with is the following: > > I have a website running MyPHPNuke (a Content Management System - > visitors can enter news, which I then review and eventually post on > the page - in some ways similar to Slashdot). Every time someone > enters a new news item, I would like to be notified of this. Jabber > seems like a good way to do this. > > However, there is a problem. Every time I want to send a message, a > connection to Jabber should be open. I can do this with Perl, but I > still need to sleep() some time, because I'm waiting for the Jabber > server to respond. When the connection is open, I can send my > message. After this, the connection is closed, and the page can finish > loading. > > Schematic view: > 1. User submits new story > 2. Server starts new process to handle this request > 3. Server process opens connection to Jabber server > 4. Server process sends message > 5. Server process closes connection to Jabber server > 6. Server process returns page to user > > Can you see the problem? Steps 3 and 5 should be avoidable. > > My suggestion is: > > At boot time, some sort of 'client deamon' is started, and it logs in > to the Jabber server. When I want a PHP script to send a message to > me, it only does a small call to some application, that then connects > to the daemon to send it. > > Maybe there this should work in two ways: I can send a message to 'the > machine', to execute some task. > > I'm sorry if all this sounds confusing, but I don't know how to > explain it otherwise. > > Greetings, > > Jan Fabry > -- > Vlaamse Scholierenkoepel vzw > Paleizenstraat 90 > 1030 Brussel > 02-215 32 29 > 02-215 41 78 (fax) > [EMAIL PROTECTED] > **** Bezoek onze website: http://www.vsknet.be *** > > _______________________________________________ > jdev mailing list > [EMAIL PROTECTED] > http://mailman.jabber.org/listinfo/jdev -- Joe Hildebrand Chief Architect Jabber, Inc. http://www.jabber.com/ _______________________________________________ jdev mailing list [EMAIL PROTECTED] http://mailman.jabber.org/listinfo/jdev
