For a long time, making a server that responds to some request that runs server-side was the domain of Perl. It was built for the task, and still does it quite well - but, there's a new kid on the block, and Zend wants to prove it.
In their latest, Writing Socket Servers in PHP, the author steps you through what a socket server is, types of sockets, and even how to roll your own server to respond to a request on port 9000. They give you the code to get you started, everything from the creation of the socket to grabbing the request made and spitting back the results. The small server they show takes in a string as input and spits back the same thing, only with the whitespaces stripped. Once you get that concept firmly under your belt, they dive a little deeper. They take the same concept, but show you how to make it run indefinitely, creating more of a real server than before.
I've tried something like this before, but it was an older version of PHP. There were some issues with memory leaks, but overall, the perfomance was really pretty good. I wouldn't recommend using it for heavy-duty applications, but it's still a valid choice for smaller, possibly internal servers.




