Net_Portscan::checkPort() -- check for available service Описание
This function checks if there is a service available at the
specified port on the specified machine.
Параметр
string $host - address of the host
to check
string $port - port to check
string $timeout -
time in seconds to wait for response from host
Возвращаемое значение
boolean - Возвращает TRUE в случае успеха и FALSE при неудаче.
ЗаметкаЭта функция может быть вызвана статически. ПримерПример 34-1. Using checkPort
<?php
require_once "Net_Portscan/Portscan.php";
if (Net_Portscan::checkPort("localhost", 80) == NET_PORTSCAN_SERVICE_FOUND) {
echo "There is a service on localhost on port 80 (" . Net_Portscan::getService(80) . ").\n";
}
?>
|
|
|