00001 00002 00003 #ifndef TCPMEM_HH 00004 #define TCPMEM_HH 00005 00006 #include "rcs_defs.hh" /* EXTERN_C_STD_HEADERS */ 00007 #include "cms.hh" /* class CMS */ 00008 #include "rem_msg.hh" // REMOTE_CMS_REQUEST_TYPE 00009 #include "sokintrf.h" // hostent, sockaddr_in 00010 00011 00012 #ifdef EXTERN_C_STD_HEADERS 00013 extern "C" 00014 { 00015 #endif 00016 00017 #ifdef EXTERN_C_STD_HEADERS 00018 } 00019 #endif 00020 00021 class TCPMEM:public CMS 00022 { 00023 public: 00024 TCPMEM (char *bufline, char *procline); 00025 virtual ~ TCPMEM (); 00026 00027 /* Overloaded CMS functions. */ 00028 CMS_STATUS clear (); 00029 int check_if_read (); 00030 CMS_STATUS read (); 00031 CMS_STATUS blocking_read (double); 00032 CMS_STATUS peek (); 00033 CMS_STATUS write (void *data); 00034 CMS_STATUS write_if_read (void *data); 00035 int login (const char *, const char *); 00036 void reconnect (); 00037 void disconnect (); 00038 CMS_DIAGNOSTICS_INFO *get_diagnostics_info (); 00039 00040 protected: 00041 CMS_STATUS handle_old_replies (); 00042 void send_diag_info (); 00043 char diag_info_buf[0x400]; 00044 int recvd_bytes; 00045 long serial_number; 00046 long returned_serial_number; 00047 int subscription_type; 00048 int poll_interval_millis; 00049 #ifndef VXWORKS 00050 struct hostent *server_host_entry; 00051 #endif 00052 struct sockaddr_in server_socket_address; 00053 int socket_fd; 00054 char temp_buffer[0x2000]; 00055 REMOTE_CMS_REQUEST_TYPE timedout_request; 00056 long bytes_to_throw_away; 00057 int polling; 00058 int write_socket_fd; 00059 int read_socket_fd; 00060 long write_serial_number; 00061 long read_serial_number; 00062 void set_socket_fds (int new_fd); 00063 CMS_STATUS timedout_request_status; 00064 unsigned long timedout_request_writeid; 00065 int max_consecutive_timeouts; 00066 int waiting_for_message; 00067 unsigned long waiting_message_size; 00068 unsigned long waiting_message_id; 00069 int autoreconnect; 00070 int reconnect_needed; 00071 int sigpipe_count; 00072 void (*old_handler) (int); 00073 void disable_sigpipe (); 00074 void reenable_sigpipe (); 00075 void verify_bufname (); 00076 int subscription_count; 00077 }; 00078 00079 00080 00081 00082 #endif