00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef NetworkAgent_H
00024 #define NetworkAgent_H
00025
00026 #include "micolelib.h"
00027
00028 #include <config.h>
00029 #include "MicoleAgentThread.h"
00030 #include <winsock2.h>
00031
00032 #include <iostream>
00033
00034
00035 using namespace std;
00036
00037
00061 class MICOLELIB_API NetworkAgent : MicoleAgentThread
00062 {
00063 private:
00064 void initSocket(char * domain, int port);
00065 void handleNetworkMessage ( MicoleBus *app, int argc, const char **argv );
00066 SOCKET _sock;
00067
00068
00069 public:
00070
00071 NetworkAgent(char * domain, int port);
00072
00073 ~NetworkAgent();
00074
00078 virtual void run();
00079 void sendOnNetwork(string s);
00080
00081 protected:
00085 virtual void prepareToStop(int argc, const char **argv);
00089 virtual void prepareToSuspend(int argc, const char **argv);
00090
00091 };
00092
00093 #endif
00094