CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <stdio.h>
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  int WaitData(int timeout);
49 
50 };
51 
52 #endif
int Receive(char *buffer, int size)
Definition: DTSpyHelper.cc:197
int Send(char *buffer, int size)
Definition: DTSpyHelper.cc:217
int Disconnect()
Definition: DTSpyHelper.cc:114
int errornumber
Definition: DTSpyHelper.h:14
struct sockaddr_in myaddr
Definition: DTSpyHelper.h:28
short Id()
Definition: DTSpyHelper.cc:98
void Connect(const char *hostaddr, int port)
Definition: DTSpyHelper.cc:162
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
DTCtcp * Accept()
Definition: DTSpyHelper.cc:121
unsigned long addr()
Definition: DTSpyHelper.cc:106
struct sockaddr_in clientAddr
Definition: DTSpyHelper.h:27
tuple size
Write out results.
int WaitData(int timeout)
Definition: DTSpyHelper.cc:177