class CRM_Utils_Network

Simple static helpers for network operations

Methods

static bool
waitForServiceStartup($host, $port, int $serverStartupTimeOut, float $interval = 0.333)

Try connecting to a TCP service; if it fails, retry. Repeat until serverStartupTimeOut elapses.

static bool
checkService(string $host, string $port, string $serverConnectionTimeOut)

Check whether a TCP service is available on $host and $port.

Details

at line 50
static bool waitForServiceStartup($host, $port, int $serverStartupTimeOut, float $interval = 0.333)

Try connecting to a TCP service; if it fails, retry. Repeat until serverStartupTimeOut elapses.

Parameters

$host
$port
int $serverStartupTimeOut Seconds.
float $interval Seconds to wait in between pollings.

Return Value

bool TRUE if service is online

at line 75
static bool checkService(string $host, string $port, string $serverConnectionTimeOut)

Check whether a TCP service is available on $host and $port.

Parameters

string $host
string $port
string $serverConnectionTimeOut

Return Value

bool