Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

CMS_SERVER_REMOTE_PORT Class Reference

#include <cms_srv.hh>

Inheritance diagram for CMS_SERVER_REMOTE_PORT:

Inheritance graph
[legend]
Collaboration diagram for CMS_SERVER_REMOTE_PORT:

Collaboration graph
[legend]

Public Methods

 CMS_SERVER_REMOTE_PORT (CMS_SERVER *)
virtual ~CMS_SERVER_REMOTE_PORT ()
virtual void run ()=0
virtual void register_port ()
virtual void unregister_port ()
virtual int accept_local_port_cms (CMS *cms)
CMS_USER_INFOget_connected_user (int)
void add_connected_user (int)

Data Fields

int port_registered
CMS_USER_INFOcurrent_user_info
int running
int max_total_subdivisions
int port_num
int max_clients
int current_clients

Static Protected Methods

CMS_SERVERfind_server (long _pid, long _tid=0)
void print_servers ()

Protected Attributes

RCS_LINKED_LISTconnected_users
CMS_USER_CONNECT_STRUCTcurrent_connected_user_struct
int security_enabled
CMS_SERVERcms_server_parent
double min_compatible_version
int confirm_write

Friends

class CMS_SERVER

Constructor & Destructor Documentation

CMS_SERVER_REMOTE_PORT::CMS_SERVER_REMOTE_PORT CMS_SERVER   _cms_server_parent
 

Definition at line 244 of file cms_srv.cc.

00246 {
00247   current_clients = 0;
00248   max_clients = 0;
00249   port_registered = 0;
00250   cms_server_parent = _cms_server_parent;
00251   connected_users = NULL;
00252   security_enabled = 0;
00253   confirm_write = 0;
00254   min_compatible_version = 0.0;
00255   current_user_info = NULL;
00256   running = 0;
00257   max_total_subdivisions = _cms_server_parent->max_total_subdivisions;
00258 }

CMS_SERVER_REMOTE_PORT::~CMS_SERVER_REMOTE_PORT   [virtual]
 

Definition at line 260 of file cms_srv.cc.

00261 {
00262   if (NULL != connected_users)
00263     {
00264       CMS_USER_CONNECT_STRUCT *connected_user_struct =
00265         (CMS_USER_CONNECT_STRUCT *) connected_users->get_head ();
00266       while (NULL != connected_user_struct)
00267         {
00268           delete connected_user_struct;
00269           connected_user_struct = NULL;
00270           connected_users->delete_current_node ();
00271           connected_user_struct =
00272             (CMS_USER_CONNECT_STRUCT *) connected_users->get_next ();
00273         }
00274       delete connected_users;
00275     }
00276   current_connected_user_struct = NULL;
00277 }


Member Function Documentation

virtual void CMS_SERVER_REMOTE_PORT::run   [pure virtual]
 

Reimplemented in CMS_SERVER_REMOTE_RPC_PORT, CMS_SERVER_REMOTE_STCP_PORT, CMS_SERVER_REMOTE_TCP_PORT, CMS_SERVER_REMOTE_TTY_PORT, and CMS_SERVER_REMOTE_UDP_PORT.

Referenced by CMS_SERVER::run().

void CMS_SERVER_REMOTE_PORT::register_port   [virtual]
 

Reimplemented in CMS_SERVER_REMOTE_RPC_PORT, CMS_SERVER_REMOTE_STCP_PORT, CMS_SERVER_REMOTE_TCP_PORT, CMS_SERVER_REMOTE_TTY_PORT, and CMS_SERVER_REMOTE_UDP_PORT.

Definition at line 335 of file cms_srv.cc.

Referenced by CMS_SERVER::register_server().

00336 {
00337   return;
00338 }

void CMS_SERVER_REMOTE_PORT::unregister_port   [virtual]
 

Reimplemented in CMS_SERVER_REMOTE_RPC_PORT, CMS_SERVER_REMOTE_STCP_PORT, CMS_SERVER_REMOTE_TCP_PORT, CMS_SERVER_REMOTE_TTY_PORT, and CMS_SERVER_REMOTE_UDP_PORT.

Definition at line 341 of file cms_srv.cc.

Referenced by CMS_SERVER::unregister_server().

00342 {
00343   return;
00344 }

int CMS_SERVER_REMOTE_PORT::accept_local_port_cms CMS   _cms [virtual]
 

Reimplemented in CMS_SERVER_REMOTE_RPC_PORT, CMS_SERVER_REMOTE_STCP_PORT, CMS_SERVER_REMOTE_TCP_PORT, CMS_SERVER_REMOTE_TTY_PORT, and CMS_SERVER_REMOTE_UDP_PORT.

Definition at line 347 of file cms_srv.cc.

Referenced by CMS_SERVER::accept_local_port_cms().

00348 {
00349   if (NULL != _cms)
00350     {
00351       if (min_compatible_version < 1e-6 ||
00352           (min_compatible_version > _cms->min_compatible_version &&
00353            _cms->min_compatible_version > 1e-6))
00354         {
00355           min_compatible_version = _cms->min_compatible_version;
00356         }
00357     }
00358   if (_cms->total_subdivisions > max_total_subdivisions)
00359     {
00360       max_total_subdivisions = _cms->total_subdivisions;
00361     }
00362   return 1;
00363 }

CMS_USER_INFO * CMS_SERVER_REMOTE_PORT::get_connected_user int    _fd
 

Definition at line 306 of file cms_srv.cc.

00307 {
00308   current_connected_user_struct = NULL;
00309   if (NULL == connected_users)
00310     {
00311       connected_users = new RCS_LINKED_LIST ();
00312     }
00313   if (NULL == connected_users)
00314     {
00315       return NULL;
00316     }
00317   CMS_USER_CONNECT_STRUCT *connected_user_struct =
00318     (CMS_USER_CONNECT_STRUCT *) connected_users->get_head ();
00319   while (NULL != connected_user_struct)
00320     {
00321       if (connected_user_struct->fd == _fd)
00322         {
00323           current_connected_user_struct = connected_user_struct;
00324           return connected_user_struct->user_info;
00325         }
00326       connected_user_struct =
00327         (CMS_USER_CONNECT_STRUCT *) connected_users->get_next ();
00328     }
00329   add_connected_user (_fd);
00330   return NULL;
00331 }

void CMS_SERVER_REMOTE_PORT::add_connected_user int    _fd
 

Definition at line 280 of file cms_srv.cc.

Referenced by get_connected_user().

00281 {
00282   current_connected_user_struct = NULL;
00283   rcs_print_debug (PRINT_SOCKET_CONNECT, "Adding connected user %d\n", _fd);
00284   CMS_USER_CONNECT_STRUCT *connected_user_struct =
00285     new CMS_USER_CONNECT_STRUCT ();
00286   if (NULL == connected_user_struct)
00287     {
00288       return;
00289     }
00290   connected_user_struct->fd = _fd;
00291   if (NULL == connected_users)
00292     {
00293       connected_users = new RCS_LINKED_LIST ();
00294     }
00295   if (NULL == connected_users)
00296     {
00297       return;
00298     }
00299   connected_users->store_at_tail (connected_user_struct,
00300                                   sizeof (connected_user_struct), 0);
00301   current_connected_user_struct = connected_user_struct;
00302   //delete connected_user_struct;
00303 }

CMS_SERVER * CMS_SERVER_REMOTE_PORT::find_server long    _pid,
long    _tid = 0
[static, protected]
 

Definition at line 367 of file cms_srv.cc.

Referenced by CMS_SERVER_REMOTE_RPC_PORT::dispatch(), CMS_SERVER_REMOTE_TTY_PORT::handle_request(), CMS_SERVER_REMOTE_UDP_PORT::run(), and CMS_SERVER_REMOTE_UDP_PORT::update_subscriptions().

00368 {
00369   CMS_SERVER *cms_server;
00370 #ifdef VXWORKS
00371   if (NULL != cms_server_list_mutex)
00372     {
00373       semTake (cms_server_list_mutex, WAIT_FOREVER);
00374     }
00375   else
00376     {
00377       taskLock ();
00378     }
00379 #endif
00380 
00381   if (NULL == cms_server_list)
00382     {
00383       return NULL;
00384     }
00385 
00386   cms_server = (CMS_SERVER *) cms_server_list->get_head ();
00387   while (NULL != cms_server)
00388     {
00389 #ifdef WIN32
00390       if (cms_server->server_pid == ((DWORD) _pid)
00391           && cms_server->server_tid == ((DWORD) _tid))
00392 #else
00393       if (cms_server->server_pid == _pid && cms_server->server_tid == _tid)
00394 #endif
00395         {
00396           break;
00397         }
00398       cms_server = (CMS_SERVER *) cms_server_list->get_next ();
00399     }
00400 
00401 #ifdef VXWORKS
00402   if (NULL != cms_server_list_mutex)
00403     {
00404       semGive (cms_server_list_mutex);
00405     }
00406   else
00407     {
00408       taskUnlock ();
00409     }
00410 #endif
00411   return (cms_server);
00412 }

void CMS_SERVER_REMOTE_PORT::print_servers   [static, protected]
 

Definition at line 415 of file cms_srv.cc.

Referenced by CMS_SERVER_REMOTE_RPC_PORT::dispatch().

00416 {
00417   CMS_SERVER *cms_server;
00418 
00419   if (NULL == cms_server_list)
00420     {
00421       rcs_print ("cms_server_list is NULL.\n");
00422       return;
00423     }
00424 
00425   cms_server = (CMS_SERVER *) cms_server_list->get_head ();
00426   rcs_print ("Server Tasks for this remote port.\n");
00427   while (NULL != cms_server)
00428     {
00429       rcs_print (" \t(%d (0x%X), %d (0x%X))\n",
00430                  cms_server->server_pid, cms_server->server_pid,
00431                  cms_server->server_tid, cms_server->server_tid);
00432 
00433       cms_server = (CMS_SERVER *) cms_server_list->get_next ();
00434     }
00435 }


Friends And Related Function Documentation

friend class CMS_SERVER [friend]
 

Definition at line 117 of file cms_srv.hh.


Field Documentation

int CMS_SERVER_REMOTE_PORT::port_registered
 

Definition at line 105 of file cms_srv.hh.

Referenced by CMS_SERVER::run().

CMS_USER_INFO* CMS_SERVER_REMOTE_PORT::current_user_info
 

Definition at line 106 of file cms_srv.hh.

Referenced by CMS_SERVER::process_request().

RCS_LINKED_LIST* CMS_SERVER_REMOTE_PORT::connected_users [protected]
 

Definition at line 111 of file cms_srv.hh.

CMS_USER_CONNECT_STRUCT* CMS_SERVER_REMOTE_PORT::current_connected_user_struct [protected]
 

Definition at line 112 of file cms_srv.hh.

Referenced by CMS_SERVER::process_request().

int CMS_SERVER_REMOTE_PORT::security_enabled [protected]
 

Definition at line 113 of file cms_srv.hh.

Referenced by CMS_SERVER::add_local_port().

CMS_SERVER* CMS_SERVER_REMOTE_PORT::cms_server_parent [protected]
 

Definition at line 114 of file cms_srv.hh.

double CMS_SERVER_REMOTE_PORT::min_compatible_version [protected]
 

Definition at line 118 of file cms_srv.hh.

int CMS_SERVER_REMOTE_PORT::confirm_write [protected]
 

Definition at line 119 of file cms_srv.hh.

int CMS_SERVER_REMOTE_PORT::running
 

Definition at line 121 of file cms_srv.hh.

Referenced by CMS_SERVER::run(), and CMS_SERVER::spawn().

int CMS_SERVER_REMOTE_PORT::max_total_subdivisions
 

Definition at line 122 of file cms_srv.hh.

Referenced by CMS_SERVER::initialize_write_request_space().

int CMS_SERVER_REMOTE_PORT::port_num
 

Definition at line 123 of file cms_srv.hh.

int CMS_SERVER_REMOTE_PORT::max_clients
 

Definition at line 124 of file cms_srv.hh.

int CMS_SERVER_REMOTE_PORT::current_clients
 

Definition at line 125 of file cms_srv.hh.


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 15:58:24 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001