#! / usr / local / bin / php -q ?php error_reporting (E_ALL); / * Allow the script to hang around waiting for connections. * / set_time_limit (0); / * Turn on implicit output flushing so we see what we're getting * as it comes in. * / ob_implicit_flush (); $address = '192.168.1.53'; $port = 10000; if (($sock = socket_create (AF_INET, SOCK_STREAM, 0)) 0) {echo "socket_create() failed: reason: ". socket_strerror ($sock). "\n";} if (($ret = socket_bind ($sock, $address, $port)) 0) {echo "socket_bind() failed: reason:". socket_strerror ($ret). "\n";} if (($ret = socket_listen ($sock, 5)) 0) {echo "socket_listen() failed: reason: ". socket_strerror ($ret). "\n";} do {if (($msgsock = socket_accept($sock)) 0) {echo "socket_accept() failed: reason:". socket_strerror ($msgsock). "\n"; break;} / * Send instructions. * / $msg = "\nWelcome to the PHP Test Server. \n ". "To quit, type'quit '.
#! / usr / local / bin / php -q ?php error_reporting (E_ALL); / * Permet au script de s'ex eacute;cuter ind eacute;finiment, pour attendre une connexion. * / set_time_limit (0); / * Active explicitement l'envoi automatique aux visiteurs * au fur et agrave; mesure que nous recevons les donn eacute;es * / ob_implicit_flush (); $address = '192.168.1.53'; $port = 10000; if (($sock = socket_create (AF_INET, SOCK_STREAM, 0)) 0) {echo "socket_create() failed: reason: ". socket_strerror ($sock). "\n";} if (($ret = socket_bind ($sock, $address, $port)) 0) {echo "socket_bind() a eacute;chou eacute;: raison:". socket_strerror ($ret). "\n";} if (($ret = socket_listen ($sock, 5)) 0) {echo "socket_listen() a eacute;chou eacute;: raison: ". socket_strerror ($ret). "\n";} do {if (($msgsock = socket_accept($sock)) 0) {echo "socket_accept() a eacute;chou eacute;: raison:". socket_strerror ($msgsock). "\n"; break;} / * Envoie des instructions. * / $msg = "\nBienvenue au serveur de test PHP. \n ". "Pour quitter, tapez 'quit '.