> 
> **Possible Duplicate:**  
> 
> [A PHP Socket Server with Flash Clients](https://stackoverflow.com/questions/2122792/a-php-socket-server-with-flash-clients) 
> 
> 
> 

I am building an app in my server with the help of a flash developer, and he asked me to build a socket server to communicate with the database. He recommended me JAVA but I am not very good at JAVA and I was wondering if it was possible to build a Socket Server in PHP.

I should allow connections to multiple TCP client connections. I know in JAVA this is done thought threading, but I am not sure if this can also be achieved with PHP.

Could someone please show me the basic skeleton of a PHP Socket Server with these characteristics?

The connection has to be TCp (persistent) from the beginning of the connection to the app, until the end.