diff options
author | bju <bju@maxi.fritz.box> | 2011-03-31 00:37:16 +0200 |
---|---|---|
committer | bju <bju@maxi.fritz.box> | 2011-03-31 00:37:16 +0200 |
commit | 32ba3fb9f2a1f7b073b3a121762385ac237a2af8 (patch) | |
tree | f3cbdbe2ced3e202d0c1cd3d037a8ed3108817e2 /vdr-vdrmanager/select.h | |
parent | acc1396153d7fb9c22d2b3cee3f2eef383ad681d (diff) | |
download | vdr-manager-32ba3fb9f2a1f7b073b3a121762385ac237a2af8.tar.gz vdr-manager-32ba3fb9f2a1f7b073b3a121762385ac237a2af8.tar.bz2 |
Renamed from androvdr to vdrmanager
Diffstat (limited to 'vdr-vdrmanager/select.h')
-rw-r--r-- | vdr-vdrmanager/select.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/vdr-vdrmanager/select.h b/vdr-vdrmanager/select.h new file mode 100644 index 0000000..fbdeb02 --- /dev/null +++ b/vdr-vdrmanager/select.h @@ -0,0 +1,41 @@ +/* + * encapsulated poll + */ + +#ifndef _VDRMON_SELECT +#define _VDRMON_SELECT + +#include <string> +#include <sys/select.h> +#include "sock.h" +#include "handler.h" + +struct node; +class cSelect +{ +private: + node * clientsockets; + int clientsocketcount; + cVdrmanagerServerSocket * serversocket; + cHandler * handler; + struct pollfd * pollfds; + bool stopped; + time_t nexttimer; + time_t shutdown; +public: + cSelect(); + virtual ~cSelect(); + void DispatchVdrEvent(string event); + void SetServerSocket(cVdrmanagerServerSocket * sock); + void AddClientSocket(cVdrmanagerClientSocket * sock); + void RemoveClientSocket(cVdrmanagerClientSocket * sock); + bool Action(); + bool Stop(); +private: + void CreatePollfds(); + cVdrmanagerClientSocket * GetClientSocket(int fd); + bool Poll(); + void NotifyClients(string event); +}; + +#endif |