stream_client.php 260 B

123456789
  1. <?php
  2. $fp = stream_socket_client("tcp://172.16.51.114:8000", $errno, $errstr, 30);
  3. if (!$fp) {
  4. echo "$errstr ($errno)<br />\n";
  5. } else {
  6. fwrite($fp, "GET / HTTP/1.0\r\nHost: www.example.com\r\nAccept: */*\r\n\r\n");
  7. sleep(1000);
  8. fclose($fp);
  9. }