Add delay after wsssht launch to ensure daemon is ready

- Sleep 1 second after forking wsssht to allow it to start listening
- Prevents connection attempts before wsssht is ready
parent 8934cc22
......@@ -219,6 +219,8 @@ static wsssht_process_t *find_or_create_wsssht_process(const char *hostname, con
} else if (pid > 0) {
proc->pid = pid;
printf("[WEB-PROXY] Launched wsssht daemon for %s (PID: %d, Port: %d)\n", hostname, pid, proc->port);
// Give wsssht time to start listening
sleep(1);
} else {
proc->active = false;
wsssht_processes_count--;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment