Improved output connect to input timeout behaviour
This commit is contained in:
parent
53dfcfe131
commit
49cb493b7e
1 changed files with 11 additions and 3 deletions
|
@ -167,22 +167,30 @@ namespace Mist {
|
||||||
if (statsPage.getData()){
|
if (statsPage.getData()){
|
||||||
statsPage.finish();
|
statsPage.finish();
|
||||||
}
|
}
|
||||||
statsPage = IPC::sharedClient(SHM_STATISTICS, STAT_EX_SIZE, true);
|
|
||||||
if (nProxy.userClient.getData()){
|
if (nProxy.userClient.getData()){
|
||||||
nProxy.userClient.finish();
|
nProxy.userClient.finish();
|
||||||
}
|
}
|
||||||
char userPageName[NAME_BUFFER_SIZE];
|
char userPageName[NAME_BUFFER_SIZE];
|
||||||
snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str());
|
snprintf(userPageName, NAME_BUFFER_SIZE, SHM_USERS, streamName.c_str());
|
||||||
|
unsigned int attempts = 0;
|
||||||
|
while (!nProxy.userClient.isAlive() && ++attempts < 20 && Util::streamAlive(streamName)){
|
||||||
nProxy.userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true);
|
nProxy.userClient = IPC::sharedClient(userPageName, PLAY_EX_SIZE, true);
|
||||||
|
}
|
||||||
|
if (!nProxy.userClient.isAlive()){
|
||||||
|
FAIL_MSG("Could not register as client for %s", streamName.c_str());
|
||||||
|
onFail();
|
||||||
|
return;
|
||||||
|
}
|
||||||
char pageId[NAME_BUFFER_SIZE];
|
char pageId[NAME_BUFFER_SIZE];
|
||||||
snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
|
snprintf(pageId, NAME_BUFFER_SIZE, SHM_STREAM_INDEX, streamName.c_str());
|
||||||
nProxy.metaPages.clear();
|
nProxy.metaPages.clear();
|
||||||
nProxy.metaPages[0].init(pageId, DEFAULT_STRM_PAGE_SIZE);
|
nProxy.metaPages[0].init(pageId, DEFAULT_STRM_PAGE_SIZE);
|
||||||
if (!nProxy.metaPages[0].mapped){
|
if (!nProxy.metaPages[0].mapped){
|
||||||
FAIL_MSG("Could not connect to server for %s", streamName.c_str());
|
FAIL_MSG("Could not connect to data for %s", streamName.c_str());
|
||||||
onFail();
|
onFail();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
statsPage = IPC::sharedClient(SHM_STATISTICS, STAT_EX_SIZE, true);
|
||||||
stats(true);
|
stats(true);
|
||||||
updateMeta();
|
updateMeta();
|
||||||
selectDefaultTracks();
|
selectDefaultTracks();
|
||||||
|
|
Loading…
Add table
Reference in a new issue