impr: Make ImHex not use lots of CPU when waiting for conditions

This commit is contained in:
WerWolv
2023-06-18 10:18:58 +02:00
parent 03f377bf40
commit 5f6bc2507c
2 changed files with 4 additions and 3 deletions

View File

@@ -16,9 +16,10 @@ namespace hex::plugin::builtin {
void handleNetworkInterfaceService() {
if (!networkInterfaceServiceEnabled) {
std::this_thread::yield();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
return;
}
static wolv::net::SocketServer networkInterfaceServer(31337);
networkInterfaceServer.accept([](auto, const std::vector<u8> &data) -> std::vector<u8> {
nlohmann::json result;