CMS 3D CMS Logo

DTSpyHelper.h
Go to the documentation of this file.
1 #ifndef DaqSource_DTSpyHelper_h
2 #define DaqSource_DTSpyHelper_h
3 
4 
5 #include <sys/types.h>
6 #include <sys/socket.h>
7 #include <netinet/tcp.h>
8 #include <netinet/in.h>
9 #include <cstdio>
10 #include <netdb.h>
11 
12 class DTtcpExcp
13 {
15  public:
16  DTtcpExcp(int err):errornumber(err){};
17 };
18 
19 class DTCtcp
20 {
21  protected:
22 
23  int port;
24  int sock;
25 
26  int connected;
27  struct sockaddr_in clientAddr;
28  struct sockaddr_in myaddr;
29 
30 
31  public:
32 
33  DTCtcp();
34  DTCtcp(int port);
35  DTCtcp(int sock,int opt);
36  DTCtcp(DTCtcp *);
37  ~DTCtcp();
38 
39  DTCtcp * Accept();
40  void Connect(const char *hostaddr,int port);
41  void Connect(unsigned long hostaddr,int port);
42  int Disconnect();
43 
44  short Id();
45  unsigned long addr();
46  int Send(char * buffer,int size);
47  int Receive(char *buffer,int size);
48 
49 };
50 
51 #endif
size
Write out results.
int errornumber
Definition: DTSpyHelper.h:14
int sock
Definition: DTSpyHelper.h:24
int connected
Definition: DTSpyHelper.h:26
int port
Definition: DTSpyHelper.h:23
DTtcpExcp(int err)
Definition: DTSpyHelper.h:16