diff --git a/client/controller.cpp b/client/controller.cpp index db1381dc..e240aefb 100644 --- a/client/controller.cpp +++ b/client/controller.cpp @@ -177,16 +177,16 @@ void Controller::worker() { active_ = true; - string macAddress = clientConnection_->getMacAddress(); - if (hostId_.empty()) - hostId_ = ::getHostId(macAddress); - while (active_) { try { clientConnection_->start(); + string macAddress = clientConnection_->getMacAddress(); + if (hostId_.empty()) + hostId_ = ::getHostId(macAddress); + /// Say hello to the server msg::Hello hello(macAddress, hostId_, instance_); clientConnection_->send(&hello);