00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef LIASCLIENT_H
00015 #define LIASCLIENT_H
00016
00017 #ifndef _REENTRANT
00018 #define _REENTRANT
00019 #endif
00020
00021 #include "ace/SOCK_Connector.h"
00022 #include "ace/Svc_Handler.h"
00023 #include "ace/SOCK_Stream.h"
00024 #include "ace/SOCK_Acceptor.h"
00025 #include "ace/Synch.h"
00026 #include "ace/Connector.h"
00027 #include "ace/Acceptor.h"
00028 #include "ace/Thread.h"
00029 #include "ace/Reactor.h"
00030
00031 #include "ace/Task.h"
00032 #include "ace/Activation_Queue.h"
00033
00034 #include <string>
00035 #include <vector>
00036
00037 namespace LiasClientN
00038 {
00039
00040
00041 class Client;
00042
00043 typedef ACE_Connector<Client,ACE_SOCK_CONNECTOR> Connector;
00044
00045 class Client:
00046 public ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_MT_SYNCH>
00047 {
00048 public:
00049 Client();
00050 ~Client();
00051 int open(void*);
00052 int connect(std::string host, unsigned int port);
00053 int sendCommand(std::string command);
00054
00055 std::string receiveData();
00056 void close(void*);
00057 private:
00058 Connector* _myconnector;
00059
00060
00061 char _serverData[200];
00062 char _buff;
00063 std::string _dataString;
00064 };
00065
00066 }
00067 #endif //LIASCLIENT_H