Cancels a recording session on a Historical Server connection.
SMC_RETURN_CODE smc_terminate_playback( SMC_CONNECT_ID clientId, SMC_SESSION_ID sessionId SMC_HS_SESS_DELETE_OPT deleteOption, )
identifies the Monitor connection.
identifies the recording session to cancel.
specifies whether Historical Server should delete the data files, if any, associated with the session. The choices are SMC_HS_DELETE_FILES and SMC_HS_RETAIN_FILES.
This parameter is ignored if the session has not been initiated or if it has not started recording.
Return value |
Indicates |
---|---|
SMC_RET_SUCCESS |
Function succeeded. |
SMC_RET_FAILURE |
Function failed. |
SMC_RET_INVALID_CONNECT |
Monitor connection does not exist. |
This example assumes that:
You have created a connection to Historical Server and have a clientId.
You have successfully executed smc_create_recording_session and have a sessionId.
if (smc_terminate_recording( clientId, sessionId, SMC_HS_DELETE_FILES) != SMC_RET_SUCCESS) { printf("smc_terminate_recording failed\n"); /* do some cleanup */ }
If the recording session had already been initiated, then smc_terminate_recording cancels the session. If the session had been scheduled, but had not actually started recording, then smc_terminate_recording causes the session to be unscheduled. If the session had actually started recording, then smc_terminate_recording causes the session to end prematurely, that is, before the scheduled end time.
If the recording session had not been initiated, then smc_terminate_recording cancels definition of the recording session. After a successful call to smc_terminate_recording, the HISTORICAL connection may be used to create another recording session, or to define a playback session.
Mode |
Availability |
---|---|
SMC_SERVER_M_LIVE |
No |
SMC_SERVER_M_HISTORICAL |
Yes |
Error |
Indicates |
---|---|
SMC_RET_INVALID_SVR_MODE |
Invalid server mode. |
SMC_RET_INTERNAL_ERROR |
Internal error. |
smc_create_recording_session, smc_initiate_recording