diff options
author | lordjaxom <lordjaxom> | 2004-12-30 22:43:55 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2004-12-30 22:43:55 +0000 |
commit | 302fa2e67276bd0674e81e2a9a01b9e91dd45d8c (patch) | |
tree | a454884a16e0ffa48b5ce3e4ce1a66eb874a9de0 /server/component.h | |
download | vdr-plugin-streamdev-302fa2e67276bd0674e81e2a9a01b9e91dd45d8c.tar.gz vdr-plugin-streamdev-302fa2e67276bd0674e81e2a9a01b9e91dd45d8c.tar.bz2 |
Initial revision
Diffstat (limited to 'server/component.h')
-rw-r--r-- | server/component.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/server/component.h b/server/component.h new file mode 100644 index 0000000..2f8e605 --- /dev/null +++ b/server/component.h @@ -0,0 +1,50 @@ +/* + * $Id: component.h,v 1.1 2004/12/30 22:44:18 lordjaxom Exp $ + */ + +#ifndef VDR_STREAMDEV_SERVERS_COMPONENT_H +#define VDR_STREAMDEV_SERVERS_COMPONENT_H + +#include "tools/socket.h" +#include "tools/select.h" + +#include <vdr/tools.h> + +class cServerConnection; + +/* Basic TCP listen server, all functions virtual if a derivation wants to do + things different */ + +class cServerComponent: public cListObject { +private: + cTBSocket m_Listen; + const char *m_Protocol; + const char *m_ListenIp; + uint m_ListenPort; + +public: + cServerComponent(const char *Protocol, const char *ListenIp, uint ListenPort); + virtual ~cServerComponent(); + + /* Starts listening on the specified Port, override if you want to do things + different */ + virtual bool Init(void); + + /* Stops listening, override if you want to do things different */ + virtual void Exit(void); + + /* Adds the listening socket to the Select object */ + virtual void AddSelect(cTBSelect &Select) const { Select.Add(m_Listen); } + + /* Accepts the connection on a NewConnection() object and calls the + Welcome() on it, override if you want to do things different */ + virtual cServerConnection *CanAct(const cTBSelect &Select); + + /* Returns a new connection object for CanAct */ + virtual cServerConnection *NewConnection(void) const = 0; +}; + +class cServerComponents: public cList<cServerComponent> { +}; + +#endif // VDR_STREAMDEV_SERVERS_COMPONENT_H |