Stopping the libraries
After you have done with using the libraries, you can stop the libraries.
Stopping the libraries will releases resources taken by the libraries
Streamlibrary usesAccesslibrary internally. So, stopping theAccessbeforeStreamwill make theStreamlibrary to go to inconsistent state.
So, theStreamis recommended to stop if started before stopping theAccesslibrary.
Stopping the Stream Library
To stop the Stream library, call stop() method of Stream class.
This is a thread blocking operation.
StreamRet streamStopResult = AnyConnectApi.get().getStream().stop();
if (streamStopResult == StreamRet.OK) {
//The stream library is stopped successfully
} else {
//The stream library has failed to stop
}
StreamRet streamStopResult = stream->stop([self](){
// Tasks after stream library stopped
});
if(streamStopResult == OK){
//The stream library is stopped successfully
}else{
//The stream library has failed to stop
}
See the StreamRet section for details about streamStopResult.
Stopping the Access Library
To stop the Access library, call stop() method of Access class.
This is a thread blocking operation.
AccessRet accessStopResult = AnyConnectApi.get().getAccess().stop();
if(accessStopResult == AccessRet.OK){
//The access library is stopped successfully
}else{
//The access library has failed to stop
}
AccessRet accessStopResult = access->stop([self](const int& status){
// Tasks after access library stopped
});
if(accessStopResult == OK){
//The access library is stopped successfully
}else{
//The access library has failed to stop
}
See the Status Codes section for details about
statusofstop()callback.
See the AccessRet section for details about accessStopResult.
Updated almost 3 years ago