vdr 2.7.5
cSVDRPClientHandler Class Reference

Public Member Functions

 cSVDRPClientHandler (int TcpPort, int UdpPort)
virtual ~cSVDRPClientHandler () override
void AddClient (cSVDRPServerParams &ServerParams, const char *IpAddress)
bool Execute (const char *ServerName, const char *Command, cStringList *Response=NULL)
bool GetServerNames (cStringList *ServerNames)
bool TriggerFetchingTimers (const char *ServerName)
Public Member Functions inherited from cThread
 cThread (const char *Description=NULL, bool LowPriority=false)
virtual ~cThread ()
void SetDescription (const char *Description,...) __attribute__((format(printf
void bool Start (void)
bool Active (void)

Protected Member Functions

virtual void Action (void) override
Protected Member Functions inherited from cThread
void SetPriority (int Priority)
void SetIOPriority (int Priority)
void Lock (void)
void Unlock (void)
bool Running (void)
void Cancel (int WaitSeconds=0)

Private Member Functions

void SendDiscover (void)
void HandleClientConnection (void)
void ProcessConnections (void)
cSVDRPClientGetClientForServer (const char *ServerName)

Private Attributes

cMutex mutex
int tcpPort
cSocket udpSocket
cVector< cSVDRPClient * > clientConnections

Additional Inherited Members

Static Public Member Functions inherited from cThread
static tThreadId ThreadId (void)
static tThreadId IsMainThread (void)
static void SetMainThreadId (void)

Detailed Description

Definition at line 592 of file svdrp.c.

Constructor & Destructor Documentation

◆ cSVDRPClientHandler()

cSVDRPClientHandler::cSVDRPClientHandler ( int TcpPort,
int UdpPort )

Definition at line 615 of file svdrp.c.

References cThread::cThread(), tcpPort, and udpSocket.

◆ ~cSVDRPClientHandler()

cSVDRPClientHandler::~cSVDRPClientHandler ( )
overridevirtual

Definition at line 622 of file svdrp.c.

References cThread::Cancel(), and clientConnections.

Member Function Documentation

◆ Action()

void cSVDRPClientHandler::Action ( void )
overrideprotectedvirtual

A derived cThread class must implement the code it wants to execute as a separate thread in this function.

If this is a loop, it must check Running() repeatedly to see whether it's time to stop.

Implements cThread.

Definition at line 713 of file svdrp.c.

References HandleClientConnection(), mutex, ProcessConnections(), cThread::Running(), SendDiscover(), SVDRPClientPoller, and udpSocket.

◆ AddClient()

void cSVDRPClientHandler::AddClient ( cSVDRPServerParams & ServerParams,
const char * IpAddress )

◆ Execute()

bool cSVDRPClientHandler::Execute ( const char * ServerName,
const char * Command,
cStringList * Response = NULL )

Definition at line 729 of file svdrp.c.

References GetClientForServer(), and mutex.

◆ GetClientForServer()

cSVDRPClient * cSVDRPClientHandler::GetClientForServer ( const char * ServerName)
private

Definition at line 629 of file svdrp.c.

References clientConnections.

Referenced by Execute(), and TriggerFetchingTimers().

◆ GetServerNames()

bool cSVDRPClientHandler::GetServerNames ( cStringList * ServerNames)

◆ HandleClientConnection()

void cSVDRPClientHandler::HandleClientConnection ( void )
private

Definition at line 701 of file svdrp.c.

References AddClient(), cSVDRPServerParams::Error(), esyslog, cSVDRPServerParams::Ok(), Setup, and udpSocket.

Referenced by Action().

◆ ProcessConnections()

◆ SendDiscover()

void cSVDRPClientHandler::SendDiscover ( void )
private

Definition at line 638 of file svdrp.c.

References APIVERSNUM, Setup, spmOnly, cString::sprintf(), tcpPort, udpSocket, and VDRVERSNUM.

Referenced by Action().

◆ TriggerFetchingTimers()

bool cSVDRPClientHandler::TriggerFetchingTimers ( const char * ServerName)

Definition at line 749 of file svdrp.c.

References GetClientForServer(), mutex, and sffTimers.

Member Data Documentation

◆ clientConnections

cVector<cSVDRPClient *> cSVDRPClientHandler::clientConnections
private

◆ mutex

cMutex cSVDRPClientHandler::mutex
private

Definition at line 594 of file svdrp.c.

Referenced by Action(), AddClient(), Execute(), GetServerNames(), and TriggerFetchingTimers().

◆ tcpPort

int cSVDRPClientHandler::tcpPort
private

Definition at line 595 of file svdrp.c.

Referenced by cSVDRPClientHandler(), and SendDiscover().

◆ udpSocket

cSocket cSVDRPClientHandler::udpSocket
private

Definition at line 596 of file svdrp.c.

Referenced by Action(), cSVDRPClientHandler(), HandleClientConnection(), and SendDiscover().


The documentation for this class was generated from the following file: