#ifndef InformationServer_H #define InformationServer_H #include #include #include #include #include #include "Datenbank.h" using namespace Framework; using namespace Network; class ISKlient; class InformationServer : public Thread { private: Server *server; Server *aServer; InitDatei *ini; ISDatenbank *db; CRITICAL_SECTION cs; RCArray< ISKlient > *klients; Text *fehler; int klientAnzahl; int id; bool nichtPausiert; int empfangen; int gesendet; bool end; int ref; public: // Konstruktor InformationServer( InitDatei *zIni ); // Destruktor virtual ~InformationServer(); // nicht constant void runn(); void thread(); void schließen(); bool serverStarten(); bool serverPause(); bool serverFortsetzen(); bool serverBeenden(); bool setMaxKlients( int mc ); bool absturzKlient( int klientId ); bool removeKlient( ISKlient *zKlient ); void addGesendet( int bytes ); void addEmpfangen( int bytes ); // conatant bool istAn() const; Server *zServer() const; ISDatenbank *zDB() const; bool hatClients() const; int getId() const; char *getLetzterFehler( ) const; // Reference Counting InformationServer *getThis( ); InformationServer *release( ); }; class ISAKlient : public Thread { private: SKlient *klient; Text *name; Text *passwort; int adminId; InformationServer *is; public: // Konstruktor ISAKlient( SKlient *klient, InformationServer *is ); // Destruktor virtual ~ISAKlient( ); // nicht constant void thread( ); void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum AKlient }; class ISKlient : public Thread { private: SKlient *klient; unsigned int klientNummer; InformationServer *is; int ref; public: // Konstruktor ISKlient( SKlient *klient, InformationServer *is ); // Destruktor virtual ~ISKlient(); // nicht constant void absturz(); void thread(); // constant void errorZuKlient( const char *nachricht ) const; // sendet eine Fehlernachricht zum Klient int getKlientNummer() const; // Reference Counting ISKlient *getThis(); ISKlient *release(); }; #endif