added PKGBUILD for openssh-dnssec
[mirrors/Programs.git] / php / skripty / NE_tcp_service_checker.php
1 <?php
2
3 $address = "google.cz";
4 $port = "80";
5
6 echo("Service: $address:$port Running: ");
7
8 $master = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
9 socket_set_option($master, SOL_SOCKET,SO_REUSEADDR, 1);
10 // socket_set_option($master, SOL_SOCKET, SO_SNDTIMEO, 10); //Pokus nastavit timeout
11
12 if (socket_connect($master, $address, $port)) { //Podařilo se inicializovat spojení?
13 echo("1Yeah!\n"); //Ano
14 socket_close($master);
15 } else {
16 echo("1No!\n"); //Ne
17 }
18
19 if (socket_write ($master, "TEST")) { //Podařilo se inicializovat spojení?
20 echo("2Yeah!\n"); //Ano
21 socket_close($master);
22 } else {
23 echo("2No!\n"); //Ne
24 }
25
26 ?>
This page took 0.773578 seconds and 4 git commands to generate.