vdr 2.6.1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
cSVDRPClientHandler Class Reference

Public Member Functions

 cSVDRPClientHandler (int TcpPort, int UdpPort)
 
virtual ~cSVDRPClientHandler ()
 
void Lock (void)
 
void Unlock (void)
 
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)
 
- Protected Member Functions inherited from cThread
void SetPriority (int Priority)
 
void SetIOPriority (int Priority)
 
void Lock (void)
 
void Unlock (void)
 
virtual void Action (void)=0
 
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 593 of file svdrp.c.

Constructor & Destructor Documentation

◆ cSVDRPClientHandler()

cSVDRPClientHandler::cSVDRPClientHandler ( int  TcpPort,
int  UdpPort 
)

Definition at line 618 of file svdrp.c.

References tcpPort.

◆ ~cSVDRPClientHandler()

cSVDRPClientHandler::~cSVDRPClientHandler ( )
virtual

Definition at line 625 of file svdrp.c.

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

Member Function Documentation

◆ Action()

void cSVDRPClientHandler::Action ( void  )
protectedvirtual

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

References cPoller::Add(), cSocket::Close(), cPoller::Del(), HandleClientConnection(), cSocket::Listen(), mutex, cPoller::Poll(), ProcessConnections(), cThread::Running(), SendDiscover(), cSocket::Socket(), 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 732 of file svdrp.c.

References GetClientForServer(), and mutex.

Referenced by ExecSVDRPCommand().

◆ GetClientForServer()

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

Definition at line 632 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

◆ Lock()

void cSVDRPClientHandler::Lock ( void  )
inline

Definition at line 608 of file svdrp.c.

References cMutex::Lock(), and mutex.

Referenced by BroadcastSVDRPCommand(), ExecSVDRPCommand(), and GetSVDRPServerNames().

◆ ProcessConnections()

void cSVDRPClientHandler::ProcessConnections ( void  )
private

◆ SendDiscover()

void cSVDRPClientHandler::SendDiscover ( void  )
private

◆ TriggerFetchingTimers()

bool cSVDRPClientHandler::TriggerFetchingTimers ( const char *  ServerName)

Definition at line 752 of file svdrp.c.

References GetClientForServer(), mutex, and sffTimers.

Referenced by cSVDRPServer::CmdPOLL().

◆ Unlock()

void cSVDRPClientHandler::Unlock ( void  )
inline

Definition at line 609 of file svdrp.c.

References mutex, and cMutex::Unlock().

Referenced by BroadcastSVDRPCommand(), ExecSVDRPCommand(), and GetSVDRPServerNames().

Member Data Documentation

◆ clientConnections

cVector<cSVDRPClient *> cSVDRPClientHandler::clientConnections
private

◆ mutex

cMutex cSVDRPClientHandler::mutex
private

Definition at line 595 of file svdrp.c.

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

◆ tcpPort

int cSVDRPClientHandler::tcpPort
private

Definition at line 596 of file svdrp.c.

Referenced by cSVDRPClientHandler(), and SendDiscover().

◆ udpSocket

cSocket cSVDRPClientHandler::udpSocket
private

Definition at line 597 of file svdrp.c.

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


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