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
Stream
library usesAccess
library internally. So, stopping theAccess
beforeStream
will make theStream
library to go to inconsistent state.
So, theStream
is recommended to stop if started before stopping theAccess
library.
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
status
ofstop()
callback.
See the AccessRet section for details about accessStopResult.
Updated over 2 years ago