Well,
When my OpenRtsp Client lost connection with server, I dispose the old client and other parameters then re-create new client.
The Client send Options,Describe request successfully but failed after that... I can not able create Session and Subsesions so I got Access Violations errors..
How to reset old OpenRtspClient properly so that get new "brand" RTSPClient?
My Current Way to Reset Old Client:
I just modify the "shutdown" method in playCommon class. I did not send Teardown...
...
void ResetOurClient(){
if (env != NULL) {
env->taskScheduler().unscheduleDelayedTask(sessionTimerTask);
env->taskScheduler().unscheduleDelayedTask(arrivalCheckTimerTask);
env->taskScheduler().unscheduleDelayedTask(interPacketGapCheckTimerTask);
env->taskScheduler().unscheduleDelayedTask(qosMeasurementTimerTask);
}
closeMediaSinks();
Medium::close(session);
delete ourAuthenticator;
Medium::close(ourClient);
}
And My ReStartCode:
void StartOurClient()
{
TaskScheduler* scheduler = BasicTaskScheduler::createNew();
env = BasicUsageEnvironment::createNew(*scheduler);
char* streamURL = "XXXXXXXXX";
// Create our client object:
ourClient = createClient(*env, streamURL, verbosityLevel, progName);
if (ourClient == NULL) {
*env << "Failed to create " << clientProtocolName
<< " client: " << env->getResultMsg() << "\n";
shutdown();
}
if (sendOptionsRequest) {
// Begin by sending an "OPTIONS" command:
getOptions(continueAfterOPTIONS);
} else {
continueAfterOPTIONS(NULL, 0, NULL);
}
// All subsequent activity takes place within the event loop:
env->taskScheduler().doEventLoop(&continuesStream); // does not return
}