00001 00002 #ifndef STCP_SRV_HH 00003 #define STCP_SRV_HH 00004 00005 #include "cms_srv.hh" /* class CMS_SERVER_REMOTE_PORT */ 00006 #include "linklist.hh" /* class RCS_LINKED_LIST */ 00007 #include "rcs_defs.hh" /* EXTERN_C_STD_HEADERS */ 00008 #include "sokintrf.h" // struct sockaddr_in 00009 00010 #define MAX_STCP_BUFFER_SIZE 16 00011 class CLIENT_STCP_PORT; 00012 #define TEMP_BUFFER_MAX 512 00013 00014 class CMS_SERVER_REMOTE_STCP_PORT:public CMS_SERVER_REMOTE_PORT 00015 { 00016 public: 00017 CMS_SERVER_REMOTE_STCP_PORT (CMS_SERVER * _cms_server); 00018 virtual ~ CMS_SERVER_REMOTE_STCP_PORT (); 00019 int accept_local_port_cms (CMS *); 00020 void run (); 00021 void register_port (); 00022 void unregister_port (); 00023 00024 protected: 00025 fd_set read_fd_set, write_fd_set; 00026 void handle_request (CLIENT_STCP_PORT *); 00027 int maxfdpl; 00028 RCS_LINKED_LIST *client_ports; 00029 int connection_socket; 00030 long buffer_number; 00031 long connection_port; 00032 struct sockaddr_in server_socket_address; 00033 REMOTE_CMS_REQUEST *request; 00034 char *temp_buffer; 00035 long temp_buffer_size; 00036 int handle_request_error_occured; 00037 }; 00038 00039 class CLIENT_STCP_PORT 00040 { 00041 public: 00042 CLIENT_STCP_PORT () 00043 { 00044 errors = 0; 00045 max_errors = 50; 00046 last_write_id = -1; 00047 socket_fd = -1; 00048 } 00049 int errors, max_errors; 00050 struct sockaddr_in address; 00051 int socket_fd; 00052 int last_write_id; 00053 #if defined(WIN32) && !defined(gnuwin32) 00054 unsigned long tid; 00055 unsigned long pid; 00056 #else 00057 #ifdef VXWORKS 00058 int pid; 00059 #else 00060 pid_t pid; 00061 #endif 00062 #endif 00063 }; 00064 00065 00066 #endif /* STCP_SRV_HH */