vdr
2.4.0
|
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) |
![]() | |
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) |
![]() | |
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 tThreadId | ThreadId (void) |
static tThreadId | IsMainThread (void) |
static void | SetMainThreadId (void) |
cSVDRPClientHandler::cSVDRPClientHandler | ( | int | TcpPort, |
int | UdpPort | ||
) |
|
virtual |
Definition at line 624 of file svdrp.c.
References cThread::Cancel(), clientConnections, and cVector< T >::Size().
|
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 715 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.
void cSVDRPClientHandler::AddClient | ( | cSVDRPServerParams & | ServerParams, |
const char * | IpAddress | ||
) |
Definition at line 689 of file svdrp.c.
References cVector< T >::Append(), clientConnections, cSVDRPServerParams::Host(), mutex, cSVDRPServerParams::Name(), cSVDRPServerParams::Port(), Setup, cVector< T >::Size(), spmOnly, cSetup::SVDRPDefaultHost, cSetup::SVDRPHostName, cSetup::SVDRPPeering, and cSVDRPServerParams::Timeout().
Referenced by cSVDRPServer::CmdCONN(), and HandleClientConnection().
bool cSVDRPClientHandler::Execute | ( | const char * | ServerName, |
const char * | Command, | ||
cStringList * | Response = NULL |
||
) |
Definition at line 731 of file svdrp.c.
References GetClientForServer(), and mutex.
Referenced by ExecSVDRPCommand().
|
private |
Definition at line 631 of file svdrp.c.
References clientConnections, and cVector< T >::Size().
Referenced by Execute(), and TriggerFetchingTimers().
bool cSVDRPClientHandler::GetServerNames | ( | cStringList * | ServerNames | ) |
Definition at line 739 of file svdrp.c.
References cVector< T >::Append(), cStringList::Clear(), clientConnections, cSVDRPClient::Connected(), mutex, cSVDRPClient::ServerName(), and cVector< T >::Size().
Referenced by BroadcastSVDRPCommand(), and GetSVDRPServerNames().
|
private |
Definition at line 703 of file svdrp.c.
References AddClient(), cIpAddress::Address(), cIpAddress::Connection(), cSocket::Discover(), cSVDRPServerParams::Error(), esyslog, cSocket::LastIpAddress(), cSVDRPServerParams::Ok(), Setup, cSetup::SVDRPHostName, and udpSocket.
Referenced by Action().
|
inline |
Definition at line 607 of file svdrp.c.
References cMutex::Lock(), and mutex.
Referenced by BroadcastSVDRPCommand(), ExecSVDRPCommand(), and GetSVDRPServerNames().
|
private |
Definition at line 646 of file svdrp.c.
References APIVERSNUM, clientConnections, esyslog, cSVDRPClient::Execute(), cSVDRPClient::GetRemoteTimers(), cTimers::GetTimersRead(), cTimers::GetTimersWrite(), cSVDRPClient::HasFetchFlag(), cSVDRPClient::Process(), cStateKey::Remove(), cVector< T >::Remove(), cSVDRPClient::ServerName(), cSVDRPClient::SetFetchFlag(), Setup, sffConn, sffPing, sffTimers, cVector< T >::Size(), cString::sprintf(), StateKeySVDRPRemoteTimersPoll(), cTimers::StoreRemoteTimers(), cSetup::SVDRPHostName, SVDRPTcpPort, cSetup::SVDRPTimeout, cStateKey::TimedOut(), and VDRVERSNUM.
Referenced by Action().
|
private |
Definition at line 640 of file svdrp.c.
References APIVERSNUM, cSocket::Port(), cSocket::SendDgram(), Setup, spmOnly, cString::sprintf(), cSetup::SVDRPDefaultHost, cSetup::SVDRPHostName, cSetup::SVDRPPeering, cSetup::SVDRPTimeout, tcpPort, udpSocket, and VDRVERSNUM.
Referenced by Action().
bool cSVDRPClientHandler::TriggerFetchingTimers | ( | const char * | ServerName | ) |
Definition at line 751 of file svdrp.c.
References GetClientForServer(), mutex, and sffTimers.
Referenced by cSVDRPServer::CmdPOLL().
|
inline |
Definition at line 608 of file svdrp.c.
References mutex, and cMutex::Unlock().
Referenced by BroadcastSVDRPCommand(), ExecSVDRPCommand(), and GetSVDRPServerNames().
|
private |
Definition at line 597 of file svdrp.c.
Referenced by AddClient(), GetClientForServer(), GetServerNames(), ProcessConnections(), and ~cSVDRPClientHandler().
|
private |
Definition at line 594 of file svdrp.c.
Referenced by Action(), AddClient(), Execute(), GetServerNames(), Lock(), TriggerFetchingTimers(), and Unlock().
|
private |
Definition at line 595 of file svdrp.c.
Referenced by cSVDRPClientHandler(), and SendDiscover().
|
private |
Definition at line 596 of file svdrp.c.
Referenced by Action(), HandleClientConnection(), and SendDiscover().