remote_check()
Check the validity of a remote session.
Syntax
remote_check(sessionID)
Parameter
Parameter | Definition |
---|---|
sessionID | identifier of the remote PATROL Agent session that is to be verified The sessionID is returned by the remote_open() function when you open a remote PATROL Agent session. |
Description
The remote_check() function verifies whether a remote session to another PATROL Agent is still valid. The function returns 1 if the session is still valid. If the session is no longer valid, the function returns 0 and errno is set toE_PSL_REMOTE_SESSION_INVALID (145).
For more information on using the remote functions, see remote_open().
Example
The following example shows the remote_check() function:
mysession=remote_open(targetHost, targetPort, "PEM", user, myencrypted_passwd);
# After doing some other stuff, check to see that remote session is still valid.
if ( remote_check(sess) ) {
#We are still connected, so trigger a remote event
remote_event_trigger(mysession,"myorigin","STD","41","ALARM","5","myarg");
} else {
print ("Lost connection to remote Agent. Go to plan B.\n”);
}
# After doing some other stuff, check to see that remote session is still valid.
if ( remote_check(sess) ) {
#We are still connected, so trigger a remote event
remote_event_trigger(mysession,"myorigin","STD","41","ALARM","5","myarg");
} else {
print ("Lost connection to remote Agent. Go to plan B.\n”);
}