vdr 2.8.3
cSVDRPClientHandler Class Reference

Public Member Functions

 cSVDRPClientHandler (int TcpPort, int UdpPort)
virtual ~cSVDRPClientHandler () override
void AddClient (cSVDRPServerParams &ServerParams, const char *IpAddress)
void CloseClient (const char *ServerName)
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)
cSVDRPClient * GetClientForServer (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 602 of file svdrp.c.

Constructor & Destructor Documentation

◆ cSVDRPClientHandler()

cSVDRPClientHandler::cSVDRPClientHandler ( int TcpPort,
int UdpPort )

Definition at line 626 of file svdrp.c.

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

Referenced by StartSVDRPHandler().

◆ ~cSVDRPClientHandler()

cSVDRPClientHandler::~cSVDRPClientHandler ( )
overridevirtual

Definition at line 633 of file svdrp.c.

References cThread::Cancel(), clientConnections, and cVector< T >::Size().

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 735 of file svdrp.c.

References cPoller::Add(), cSocket::Close(), cPoller::Del(), HandleClientConnection(), cSocket::Listen(), mutex, cPoller::Poll(), ProcessConnections(), cThread::Running(), SendDiscover(), cSocket::Socket(), SVDRPClientPoller, SVDRPDiscoverDelta, and udpSocket.

◆ AddClient()

◆ CloseClient()

void cSVDRPClientHandler::CloseClient ( const char * ServerName)

Definition at line 712 of file svdrp.c.

References clientConnections, mutex, and cVector< T >::Size().

Referenced by cSVDRPServerHandler::ProcessConnections().

◆ Execute()

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

Definition at line 757 of file svdrp.c.

References GetClientForServer(), and mutex.

Referenced by ExecSVDRPCommand().

◆ GetClientForServer()

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

Definition at line 640 of file svdrp.c.

References clientConnections, and cVector< T >::Size().

Referenced by Execute(), and TriggerFetchingTimers().

◆ GetServerNames()

bool cSVDRPClientHandler::GetServerNames ( cStringList * ServerNames)

◆ HandleClientConnection()

void cSVDRPClientHandler::HandleClientConnection ( void )
private

◆ ProcessConnections()

◆ SendDiscover()

void cSVDRPClientHandler::SendDiscover ( void )
private

◆ TriggerFetchingTimers()

bool cSVDRPClientHandler::TriggerFetchingTimers ( const char * ServerName)

Definition at line 777 of file svdrp.c.

References GetClientForServer(), mutex, and sffTimers.

Referenced by cSVDRPServer::CmdPOLL().

Member Data Documentation

◆ clientConnections

cVector<cSVDRPClient *> cSVDRPClientHandler::clientConnections
private

◆ mutex

cMutex cSVDRPClientHandler::mutex
private

Definition at line 604 of file svdrp.c.

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

◆ tcpPort

int cSVDRPClientHandler::tcpPort
private

Definition at line 605 of file svdrp.c.

Referenced by cSVDRPClientHandler(), and SendDiscover().

◆ udpSocket

cSocket cSVDRPClientHandler::udpSocket
private

Definition at line 606 of file svdrp.c.

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


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