Skip to content

Commit

Permalink
wait for controller to be ready
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown321 committed Jan 17, 2025
1 parent ce91c28 commit 5454b80
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions server/armv5-unknown-linux-gnueabihf/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ bool Controller::goToPlayer() {
return true;
}

bool Controller::Ready() { return initialized; }

int Controller::Initialize() {
if (initialized) {
return 0;
Expand Down
2 changes: 2 additions & 0 deletions server/armv5-unknown-linux-gnueabihf/Controller.moc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ class Controller : public QObject {

int Initialize();

bool Ready();

void Hide(Command::Command *c);

void Show(Command::Command *c);
Expand Down
8 changes: 5 additions & 3 deletions server/armv5-unknown-linux-gnueabihf/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ void WampyServer::respond(QLocalSocket *socket, QByteArray data) {

void WampyServer::Serve() {
DLOG("serving\n");
if (controller.Initialize() != 0) {
DLOG("initialize failed\n");
return;

while (!controller.Ready()) {
if (controller.Initialize() != 0) {
DLOG("initialize failed\n");
}
}

auto t = controller.provider.thread();
Expand Down

0 comments on commit 5454b80

Please sign in to comment.