Change controller calls that use stream metadata to instantly time out if unavailable, rather than waiting for availability
This commit is contained in:
parent
f19899aed2
commit
f3ba13d6bb
4 changed files with 16 additions and 16 deletions
12
lib/dtsc.cpp
12
lib/dtsc.cpp
|
@ -901,13 +901,13 @@ namespace DTSC{
|
|||
|
||||
/// Initialize empty metadata, in master or slave mode.
|
||||
/// If stream name is empty, slave mode is enforced.
|
||||
Meta::Meta(const std::string &_streamName, bool master){
|
||||
Meta::Meta(const std::string &_streamName, bool master, bool autoBackOff){
|
||||
if (!_streamName.size()){master = false;}
|
||||
version = DTSH_VERSION;
|
||||
streamMemBuf = 0;
|
||||
isMemBuf = false;
|
||||
isMaster = master;
|
||||
reInit(_streamName, master);
|
||||
reInit(_streamName, master, autoBackOff);
|
||||
}
|
||||
|
||||
/// Initialize metadata from given DTSH file in master mode.
|
||||
|
@ -926,12 +926,12 @@ namespace DTSC{
|
|||
/// Calls clear(), then initializes freshly.
|
||||
/// If stream name is set, uses shared memory backing.
|
||||
/// If stream name is empty, uses non-shared memory backing.
|
||||
void Meta::reInit(const std::string &_streamName, bool master){
|
||||
void Meta::reInit(const std::string &_streamName, bool master, bool autoBackOff){
|
||||
clear();
|
||||
if (_streamName == ""){
|
||||
sBufMem();
|
||||
}else{
|
||||
sBufShm(_streamName, DEFAULT_TRACK_COUNT, master);
|
||||
sBufShm(_streamName, DEFAULT_TRACK_COUNT, master, autoBackOff);
|
||||
}
|
||||
streamInit();
|
||||
}
|
||||
|
@ -1118,7 +1118,7 @@ namespace DTSC{
|
|||
|
||||
/// Initializes shared memory backed mode, with enough room for the given track count.
|
||||
/// Should not be called repeatedly, nor to switch modes.
|
||||
void Meta::sBufShm(const std::string &_streamName, size_t trackCount, bool master){
|
||||
void Meta::sBufShm(const std::string &_streamName, size_t trackCount, bool master, bool autoBackOff){
|
||||
isMaster = master;
|
||||
if (isMaster){HIGH_MSG("Creating meta page for stream %s", _streamName.c_str());}
|
||||
|
||||
|
@ -1142,7 +1142,7 @@ namespace DTSC{
|
|||
streamPage.master = false;
|
||||
stream = Util::RelAccX(streamPage.mapped, false);
|
||||
}else{
|
||||
streamPage.init(pageName, bufferSize, false, true);
|
||||
streamPage.init(pageName, bufferSize, false, autoBackOff);
|
||||
if (!streamPage.mapped){
|
||||
INFO_MSG("Page %s not found", pageName);
|
||||
return;
|
||||
|
|
|
@ -284,11 +284,11 @@ namespace DTSC{
|
|||
class Meta{
|
||||
public:
|
||||
Meta(const std::string &_streamName, const DTSC::Scan &src);
|
||||
Meta(const std::string &_streamName = "", bool master = true);
|
||||
Meta(const std::string &_streamName = "", bool master = true, bool autoBackOff = true);
|
||||
Meta(const std::string &_streamName, const std::string &fileName);
|
||||
|
||||
~Meta();
|
||||
void reInit(const std::string &_streamName, bool master = true);
|
||||
void reInit(const std::string &_streamName, bool master = true, bool autoBackOff = true);
|
||||
void reInit(const std::string &_streamName, const std::string &fileName);
|
||||
void reInit(const std::string &_streamName, const DTSC::Scan &src);
|
||||
void addTrackFrom(const DTSC::Scan &src);
|
||||
|
@ -493,7 +493,7 @@ namespace DTSC{
|
|||
|
||||
protected:
|
||||
void sBufMem(size_t trackCount = DEFAULT_TRACK_COUNT);
|
||||
void sBufShm(const std::string &_streamName, size_t trackCount = DEFAULT_TRACK_COUNT, bool master = true);
|
||||
void sBufShm(const std::string &_streamName, size_t trackCount = DEFAULT_TRACK_COUNT, bool master = true, bool autoBackOff = true);
|
||||
void streamInit(size_t trackCount = DEFAULT_TRACK_COUNT);
|
||||
|
||||
std::string streamName;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue