Code
Result

PHP code example: stream_socket_server

Create an Internet or Unix domain server socket. See documentation.

You can try this function yourself. Just edit the code and on "Run" to see the result.