Attempt Fix/Clean on RTL input code; #125

This commit is contained in:
lwvmobile
2023-05-18 09:29:44 -04:00
parent e4861bf94c
commit 7b6feb9e4f
13 changed files with 171 additions and 270 deletions

View File

@@ -250,6 +250,7 @@ int UDPBind (char *hostname, int portno)
return sockfd;
}
//going to leave this function available, even if completely switched over to rtl_dev_tune now, may be useful in the future
void rtl_udp_tune(dsd_opts * opts, dsd_state * state, long int frequency)
{
int handle;
@@ -274,8 +275,5 @@ void rtl_udp_tune(dsd_opts * opts, dsd_state * state, long int frequency)
address.sin_port = htons(udp_port);
sendto(handle, data, 5, 0, (const struct sockaddr * ) & address, sizeof(struct sockaddr_in));
//BUGFIX: This was causing an indefinite number of UDP sockets to stay open on each tune request
//we open a new socket with each request, so we need to close the socket after writing to it
//this would cause the tuning to stop after x number of tune attempts (few hours? on a busy system)
close (handle); //close socket after sending.
}