Please see my comments. If find the question very weird. Anyway, if you only have PHP on server-side, this is the way to go. Please see:
http://php.net/manual/en/book.tcpwrap.php[
^].
In principle, this would be enough to implement a wide spectrum of different network communication techniques.
—SA