00001 00002 00003 #ifndef UDPMEM_HH 00004 #define UDPMEM_HH 00005 00006 #include "cms.hh" /* class CMS */ 00007 #include "sokintrf.h" // struct sockaddr_in, msghdr, iovec 00008 00009 00010 class UDPMEM:public CMS 00011 { 00012 public: 00013 UDPMEM (char *bufline, char *procline); 00014 virtual ~ UDPMEM (); 00015 00016 /* Overloaded CMS functions. */ 00017 CMS_STATUS clear (); 00018 int check_if_read (); 00019 CMS_STATUS read (); 00020 CMS_STATUS blocking_read (double); 00021 CMS_STATUS peek (); 00022 CMS_STATUS write (void *data); 00023 CMS_STATUS write_if_read (void *data); 00024 00025 protected: 00026 int call_on_server (); 00027 int verify_bufname (); 00028 int setup_subscription (); 00029 int cancel_subscription (); 00030 int init_variables (); 00031 int polling; 00032 int get_reply; 00033 int last_reply_timed_out; 00034 long reply_size; 00035 long request_size; 00036 double retry_timeout; 00037 unsigned long serial_number; 00038 unsigned long returned_serial_number; 00039 #ifndef VXWORKS 00040 struct hostent *server_host_entry; 00041 struct hostent *broadcast_server_host_entry; 00042 #endif 00043 struct sockaddr_in server_socket_address; 00044 struct sockaddr_in broadcast_server_socket_address; 00045 int socket_fd; 00046 char request_buffer[32]; 00047 char reply_buffer[32]; 00048 struct msghdr request_message_header; 00049 struct msghdr reply_message_header; 00050 int send_broadcast; 00051 long send_broadcast_addr; 00052 int recieve_broadcast; 00053 long recieve_broadcast_port; 00054 int subscription_type; 00055 int poll_interval_millis; 00056 int subscription_id; 00057 int send_request; 00058 struct sockaddr_in cli_addr; 00059 struct iovec request_iov2[2]; 00060 struct iovec reply_iov2[2]; 00061 int broadcast_subscriptions; 00062 int broadcast_clnt_port; 00063 00064 }; 00065 00066 00067 00068 00069 #endif