Add tags

Add tags to the following comment

PHP 5.1.6

$ php -q client_echo.php localhost 7 < input_file > result_file

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/usr/bin/env php
<?php
$host = $argv[1];
$port = $argv[2];

$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
socket_connect($sock, $host, $port);

while ($line = fgets(STDIN, 1024)) {
    socket_write($sock, $line, strlen($line));
    echo socket_read($sock, 1024);
}
?>

Add tags

The input will be splited to tags with space.

Index

Feed

Other

Link

Pathtraq

loading...