License Queuing Example Code

You may need to format spaces in an editor if using the sample code given below.

{/* License was available, run the application! */
}
else if (request_flag & VLS_REQ_QUEUE)
{/* Was placed on the queue */
/* TODO: Start timer for sending periodic queue updates (every 50 secs is recommended). Assume function TimerHandler () will be called when the timer expires (see below).
*/
}
}
else
{/* Queued request was not successful, clean up and exit. */
VLScleanup ();
return (1);
} /* End if success */
} /* end main () */
   void TimerHandler ()
{/* Called periodically in order to check the queue status.*/
long expiration_time;
LS_STATUS_CODE returnCode;
returnCode = VLSupdateQueuedClient (ls_handle,&expiration_time,(unsigned char    LSFAR *) NULL,(LS_CHALLENGE LSFAR *) NULL);/* Is the queued license available*/
if (returnCode == LS_SUCCESS && expiration_time > 0 )
{
if ((returnCode =VLSgetQueuedLicense(ls_handle,(unsigned char LSFAR *)         NULL,(LS_CHALLENGE LSFAR *) NULL))== LS_SUCCESS)
{
/*Disable the application’s timer and run the application! */
/* Enable automatic heartbeats to the License Manager */
VLSdisableAutoTimer (ls_handle, VLS_ON);
}
else
{/* Error getting the license, clean up and quit. */
VLScleanup ();
/* Terminate the process */
}
}
}