checkserverconnection
SERVER
,
STATUS
,
TIMEOUT

The checkserverconnection statement checks to see if the specified server is connected.


Parameters

This statement has three parameters:

server – name of the server to check. If empty, then use the server associated with the current database.

status – field or variable for result, will be set to true if the connection is ok, false if the connection is broken.

timeout – connection timeout (in seconds). If not specified, the default specified in the Client preference panel will be used.


Description

This statement tests the connection to the specified server. It returns true in the second parameter if the connection is ok, false if there is a problem.

local connectStatus
checkserverconnection "Company Server",connectStatus
if connectStatus=false()
    alertsheet "Sorry, server is not connected."
    return
endif

The default connection timeout for this function is normally specified in the Client Preferences panel (usually the default is 30 seconds), but you can add a second parameter to override this. This example will only give the server 5 seconds to respond.

local connectStatus
checkserverconnection "Company Server",connectStatus,5
if connectStatus=false()
    alertsheet "Sorry, server is not connected."
    return
endif

This function is also available as a function that can be used in a formula, see checkserverconnection(.

Note: This statement tests the connection by sending an “are you alive?” request to the server. If the server responds to this request, the connection is deemed good. Note that the “are you alive?” function is built into Panorama Server, so this is more comprehensive than a simple TCP/IP ping request, it actually verifies that Panorama Server is running and responding to requests.


See Also


History

VersionStatusNotes
10.2UpdatedThe optional connection timeout parameter was added in April 2023.
10.2UpdatedCarried over from Panorama 6.0, but works differently (returns result in second parameter instead of throwing an error).