This commit was generated by cvs2svn to compensate for changes in r12269,
[u/mrichter/AliRoot.git] / SHUTTLE / test / TestServer.h
1 #ifndef TEST_SERVER_H
2 #define TEST_SERVER_H
3
4 #include <TServerSocket.h>
5
6 class AliDCSMessage;
7
8 class TestServer: public TObject {
9 public:
10
11         static const Int_t kBadState = -1;
12
13         static const Int_t kTimeout = -2;
14
15         static const Int_t kBadMessage = -3;
16
17         static const Int_t kCommError = -4;
18
19         static const Int_t kServerError = -5;
20
21 private:
22
23         TServerSocket fServerSocket;
24
25         Long_t fTimeout;
26
27         Int_t fRetries;
28
29
30         Int_t SendBuffer(TSocket* socket, const char* buffer, Int_t size);
31
32         Int_t ReceiveBuffer(TSocket* socket, char* buffer, Int_t size);
33
34         Int_t SendMessage(TSocket* socket, AliDCSMessage& message);
35
36         Int_t ReceiveMessage(TSocket* socket, AliDCSMessage& message);
37
38 public:
39
40         TestServer(Int_t port, Long_t timeout = 5000, Int_t retries = 5);
41
42         void Run(Int_t count, Int_t rsSize);
43
44         ClassDef(TestServer, 0);
45 };
46
47 #endif