Cicode Programming Reference > Cicode Function Categories > Server Functions > ServerIsOnline

ServerIsOnline

The ServerIsOnline function checks if the given server can be contacted by the client for giving the online/offline status of the server.

This function is a blocking function. It blocks the calling Cicode task until the operation is complete.

Syntax

INT ServerIsOnline(STRING ServerName[, STRING Clusters][, INT bLocal])

ServerName:

The name of the server to be queried in quotations marks "".

Cluster:

The cluster of the server to be queried in quotation marks "". An empty string indicates that the default cluster will be used.

bLocal:

The mode of the server status check.

A value of "1" results in a local check of the server status, checking if the current computer can connect to the server directly. In local mode, this function will return a value immediately, without blocking the Cicode.

A value of "0" (default) indicates that a remote check of the server status is required to confirm if the server can be reached through its peer. In remote mode, this function will block the Cicode while waiting for a response to the query.

Return Value

An integer value of online/offline status. Returns 1 for online, 0 for offline.

Related Functions

ServerGetProperty, ServerInfo, ServerInfoEx, ServerReload, ServerRestart

Example

ServerIsOnline("AlarmServer1", "Cluster12");

See Also

Published June 2018