mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-12-26 23:06:44 +01:00
Now sending the SVDRP discover broadcast once per minute, to re-establish lost connections
This commit is contained in:
3
HISTORY
3
HISTORY
@@ -10138,7 +10138,7 @@ Video Disk Recorder Revision History
|
|||||||
- Fixed an invalid lock sequence when pressing the Channel+/Channel- keys while in the
|
- Fixed an invalid lock sequence when pressing the Channel+/Channel- keys while in the
|
||||||
"What's on..." menu in live view.
|
"What's on..." menu in live view.
|
||||||
|
|
||||||
2025-07-10:
|
2025-07-21:
|
||||||
|
|
||||||
- Fixed cPoller::Poll() to allow negative timeout values again.
|
- Fixed cPoller::Poll() to allow negative timeout values again.
|
||||||
- When regenerating the index of a recording, PID changes are now taken into account
|
- When regenerating the index of a recording, PID changes are now taken into account
|
||||||
@@ -10169,3 +10169,4 @@ Video Disk Recorder Revision History
|
|||||||
- Reverted the change in cCondWait::SleepMs() because of a possible lockup (reported by Johann
|
- Reverted the change in cCondWait::SleepMs() because of a possible lockup (reported by Johann
|
||||||
Friedrichs).
|
Friedrichs).
|
||||||
- Added cTimer::VpsTime() (suggested by Markus Ehrnsperger).
|
- Added cTimer::VpsTime() (suggested by Markus Ehrnsperger).
|
||||||
|
- Now sending the SVDRP discover broadcast once per minute, to re-establish lost connections.
|
||||||
|
|||||||
12
svdrp.c
12
svdrp.c
@@ -10,7 +10,7 @@
|
|||||||
* and interact with the Video Disk Recorder - or write a full featured
|
* and interact with the Video Disk Recorder - or write a full featured
|
||||||
* graphical interface that sits on top of an SVDRP connection.
|
* graphical interface that sits on top of an SVDRP connection.
|
||||||
*
|
*
|
||||||
* $Id: svdrp.c 5.11 2025/03/02 11:03:35 kls Exp $
|
* $Id: svdrp.c 5.12 2025/07/21 08:26:31 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "svdrp.h"
|
#include "svdrp.h"
|
||||||
@@ -246,7 +246,6 @@ bool cSocket::SendDgram(const char *Dgram, int Port)
|
|||||||
Addr.sin_port = htons(Port);
|
Addr.sin_port = htons(Port);
|
||||||
// Send datagram:
|
// Send datagram:
|
||||||
dbgsvdrp("> %s:%d %s\n", inet_ntoa(Addr.sin_addr), Port, Dgram);
|
dbgsvdrp("> %s:%d %s\n", inet_ntoa(Addr.sin_addr), Port, Dgram);
|
||||||
dsyslog("SVDRP %s > %s:%d send dgram '%s'", Setup.SVDRPHostName, inet_ntoa(Addr.sin_addr), Port, Dgram);
|
|
||||||
int Length = strlen(Dgram);
|
int Length = strlen(Dgram);
|
||||||
int Sent = sendto(Socket, Dgram, Length, 0, (sockaddr *)&Addr, sizeof(Addr));
|
int Sent = sendto(Socket, Dgram, Length, 0, (sockaddr *)&Addr, sizeof(Addr));
|
||||||
if (Sent < 0)
|
if (Sent < 0)
|
||||||
@@ -301,7 +300,6 @@ cString cSocket::Discover(void)
|
|||||||
}
|
}
|
||||||
if (strcmp(strgetval(buf, "name", ':'), Setup.SVDRPHostName) != 0) { // ignore our own broadcast
|
if (strcmp(strgetval(buf, "name", ':'), Setup.SVDRPHostName) != 0) { // ignore our own broadcast
|
||||||
dbgsvdrp("< %s discovery received (%s)\n", lastIpAddress.Connection(), buf);
|
dbgsvdrp("< %s discovery received (%s)\n", lastIpAddress.Connection(), buf);
|
||||||
isyslog("SVDRP %s < %s discovery received (%s)", Setup.SVDRPHostName, lastIpAddress.Connection(), buf);
|
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -714,8 +712,14 @@ void cSVDRPClientHandler::Action(void)
|
|||||||
{
|
{
|
||||||
if (udpSocket.Listen()) {
|
if (udpSocket.Listen()) {
|
||||||
SVDRPClientPoller.Add(udpSocket.Socket(), false);
|
SVDRPClientPoller.Add(udpSocket.Socket(), false);
|
||||||
SendDiscover();
|
time_t LastDiscover = 0;
|
||||||
|
#define SVDRPDiscoverDelta 60 // seconds
|
||||||
while (Running()) {
|
while (Running()) {
|
||||||
|
time_t Now = time(NULL);
|
||||||
|
if (Now - LastDiscover >= SVDRPDiscoverDelta) {
|
||||||
|
SendDiscover();
|
||||||
|
LastDiscover = Now;
|
||||||
|
}
|
||||||
SVDRPClientPoller.Poll(1000);
|
SVDRPClientPoller.Poll(1000);
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&mutex);
|
||||||
HandleClientConnection();
|
HandleClientConnection();
|
||||||
|
|||||||
Reference in New Issue
Block a user