32 lines
824 B
C++
32 lines
824 B
C++
#ifndef DISPATCHERSERVER_H
|
|
#define DISPATCHERSERVER_H
|
|
|
|
#include "cloudserver.h"
|
|
|
|
|
|
class DispatcherServer: public PIObject {
|
|
PIOBJECT(DispatcherServer)
|
|
public:
|
|
DispatcherServer(PIEthernet::Address addr);
|
|
~DispatcherServer();
|
|
EVENT_HANDLER0(void, printStatus);
|
|
|
|
private:
|
|
EVENT_HANDLER1(void, newConnection, PIEthernet * , cl);
|
|
EVENT_HANDLER1(void, disconnectClient, DispatcherClient *, client);
|
|
EVENT_HANDLER0(void, cleanClients);
|
|
|
|
PIEthernet eth;
|
|
PIVector<DispatcherClient*> clients;
|
|
PIMap<PIString, CloudServer *> c_servers;
|
|
PIMap<const DispatcherClient *, CloudServer *> index_c_servers;
|
|
PIMap<const DispatcherClient *, CloudServer *> index_c_clients;
|
|
PIVector<DispatcherClient*> rm_clients;
|
|
PITimer status_timer;
|
|
PITimer timeout_timer;
|
|
PIMutex map_mutex;
|
|
uint client_gid;
|
|
};
|
|
|
|
#endif // DISPATCHERSERVER_H
|