File indexing completed on 2025-08-03 08:20:53
0001 #ifndef __REMOTE_MSG_BUFFER_H__
0002 #define __REMOTE_MSG_BUFFER_H__
0003
0004
0005
0006 #include "msg_buffer.h"
0007
0008 #ifndef __CINT__
0009
0010 #include <sys/types.h>
0011 #include <unistd.h>
0012 #include <stdlib.h>
0013 #include <sys/socket.h>
0014 #include <sys/types.h>
0015 #include <sys/stat.h>
0016 #include <sys/times.h>
0017
0018 #include <netdb.h>
0019 #include <netinet/in.h>
0020 #include <arpa/inet.h>
0021
0022 #endif
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 class remote_msg_buffer : public msg_buffer {
0033
0034 protected:
0035
0036 #ifndef __CINT__
0037 STREAMBUF * original_streambuf;
0038 int ThePort;
0039 char *TheHost;
0040
0041 int sockfd;
0042 struct sockaddr_in server_addr;
0043 struct hostent *p_host;
0044
0045 void send_string(const char *x, const int len);
0046 int writen (int fd, const char *ptr, int nbytes);
0047 #endif
0048
0049
0050 public:
0051
0052
0053
0054
0055
0056
0057 remote_msg_buffer (const char *host = "va010.phenix.bnl.gov",
0058 const int port = 8400, const int msglen=256);
0059
0060
0061 virtual ~remote_msg_buffer();
0062
0063
0064
0065
0066
0067
0068
0069 #ifdef STREAMBUF_NEW_IOSTREAM
0070 virtual int pubsync ();
0071 #else
0072 virtual int sync ();
0073 #endif
0074
0075
0076 };
0077
0078
0079 #endif