You are here: Re: how to write a program (not a webpage) in php? « PHP Programming Language « IT news, forums, messages
Re: how to write a program (not a webpage) in php?

Posted by Jerry Stuckle on 09/09/05 21:36

_andrea.l wrote:
> I'd like to write a program that running all the time: just a simple
> program, but written in php.
> 1)How can i do that?
> 2) I'd like that this program listens on a port to recive a message: how can
> I do?
>
> thank you in advance.
> Andrea.
>
>

Andrea,

It's not too bad. Ewoud pointed you to the socket interface; it's as
simple as opening a socket, listening for a message, and once received,
close the socket. Loop around and do it again.

You might also want to listen for a 'special' message such as "SHUT DOWN
NOW" which tells the program to shut itself down gracefully. Otherwise
you would have to kill. Not that this *should* cause a problem - but
I'm always in favor of graceful shutdowns :-).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация