ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
remote_msg_buffer.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file remote_msg_buffer.h
1 #ifndef __REMOTE_MSG_BUFFER_H__
2 #define __REMOTE_MSG_BUFFER_H__
3 
4 
5 
6 #include "msg_buffer.h"
7 
8 #ifndef __CINT__
9 
10 #include <sys/types.h>
11 #include <unistd.h>
12 #include <stdlib.h>
13 #include <sys/socket.h>
14 #include <sys/types.h>
15 #include <sys/stat.h>
16 #include <sys/times.h>
17 
18 #include <netdb.h>
19 #include <netinet/in.h>
20 #include <arpa/inet.h>
21 
22 #endif
23 
24 
25 
32 class remote_msg_buffer : public msg_buffer {
33 
34 protected:
35 
36 #ifndef __CINT__
38  int ThePort;
39  char *TheHost;
40 
41  int sockfd;
42  struct sockaddr_in server_addr;
43  struct hostent *p_host;
44 
45  void send_string(const char *x, const int len);
46  int writen (int fd, const char *ptr, int nbytes);
47 #endif
48 
49 
50 public:
51 
52 
57  remote_msg_buffer (const char *host = "va010.phenix.bnl.gov",
58  const int port = 8400, const int msglen=256);
59 
61  virtual ~remote_msg_buffer();
62 
64 
65  // mlp -- the pubsync is what's needed for the new
66  // iostream libraries - sync will no longer be a public method.
67  // for now we leave it as it was.
68 
69 #ifdef STREAMBUF_NEW_IOSTREAM
70  virtual int pubsync ();
71 #else
72  virtual int sync ();
73 #endif
74 
75 
76 };
77 
78 
79 #endif /* __REMOTE_MSG_BUFFER_H__ */