00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef ServerAgent_H
00024 #define ServerAgent_H
00025 #include "micolelib.h"
00026
00027 #define BUTTON_LAG 0.1
00029 #include <config.h>
00030 #include "MicoleAgentThread.h"
00031 #include "DServerAgent.h"
00032
00033 #include <Display.h>
00034 #include <Scene.h>
00035 #include <Node.h>
00036 #include <Field.h>
00037
00038 #include <iostream>
00039 #include <list>
00040
00041 using namespace Reachin;
00042 using namespace std;
00043
00044 class DServerAgent;
00045
00053 class MICOLELIB_API ServerAgent : public MicoleAgentThread
00054 {
00055 private:
00056 int _port;
00057 list<DServerAgent *> _DServList;
00058
00059
00060 public:
00061 ServerAgent(int port);
00062
00063 ~ServerAgent();
00064
00068 virtual void run();
00069
00070
00071 void sendOnAllClients(string s);
00072
00073 void removeThread(DServerAgent * srv) {
00074 _DServList.remove(srv);
00075 }
00076
00077 protected:
00081 virtual void prepareToStop(int argc, const char **argv);
00085 virtual void prepareToSuspend(int argc, const char **argv);
00086
00087
00088 };
00089
00090 #endif