Location: PHPKode > projects > CourierAdmin > srv/www/htdocs/courieradmin/socketserver/server.php
#!/usr/bin/php -q
<?php
$socket = stream_socket_server("tcp://127.0.0.1:8000", $errno, $errstr);
if (!$socket) {
  echo "$errstr ($errno)<br>\n";
} else {
  while ($conn = stream_socket_accept($socket)) {
    fputs ($conn, 'Thank you for connecting to my server. The local time is ' . date('n/j/Y g:i a') . "\n");
    fclose ($conn);
  }
  fclose($socket);
}
?>
Return current item: CourierAdmin