kopia lustrzana https://github.com/Hamlib/Hamlib
-R option will keep rig open as long as 1 or more clients are connected
https://github.com/Hamlib/Hamlib/issues/1187pull/1191/head
rodzic
5b704d24fb
commit
f224e71a58
|
@ -1197,7 +1197,7 @@ void *handle_socket(void *arg)
|
|||
#ifdef HAVE_PTHREAD
|
||||
mutex_rigctld(1);
|
||||
|
||||
// ++client_count;
|
||||
++client_count;
|
||||
#if 0
|
||||
|
||||
if (!client_count++)
|
||||
|
@ -1313,14 +1313,19 @@ void *handle_socket(void *arg)
|
|||
}
|
||||
while (!ctrl_c && (retcode == RIG_OK || RIG_IS_SOFT_ERRCODE(-retcode)));
|
||||
|
||||
if (rigctld_idle)
|
||||
if (rigctld_idle && client_count == 1)
|
||||
{
|
||||
rig_close(my_rig);
|
||||
|
||||
if (verbose > RIG_DEBUG_ERR) { printf("Closed rig model %s. Will reopen for new clients\n", my_rig->caps->model_name); }
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_PTHREAD
|
||||
--client_count;
|
||||
|
||||
if (rigctld_idle && client_count > 0) { printf("%d client%s still connected so rig remains open\n", client_count, client_count > 1 ? "s" : ""); }
|
||||
|
||||
#if 0
|
||||
mutex_rigctld(1);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue