ENHANCEMENT REQUEST: notify server application about new camonitor client

Bug #1217348 reported by damijan skvarc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Won't Fix
Wishlist
mdavidsaver

Bug Description

camonitor tool can be used to monitor values which are stored in IOC database. Sometimes it would be very useful that final server application would be aware of when new a client has started to monitor certain values from data base.

In cas module this feature has already been implemented by allowing server application to be notified through casPV::interestRegister(). Unfortunately here is no similar functionality in rsrv module (at least I could not find it).

  ...
   req_server() // thread function which listen sockets and instantiate monitor server threads..
   {
          while (true) {
                listen to socket;
                create_tcp_client(); // instantiate client data structure & fork event_task() thread function, handling client notifications
                fork camsgtask() thread function to handle list of PV variables to be monitored
          }
   }

  camsgtask()
  {
          while (running && client is not disconnected) {
                ...
                camessage(client); // process client request
                ....
          }
  }

   camessage()
   {
         ......
         // when camonitor is invoked with the specified list of PV then for each specified PV
         // an internal function event_add_action() is called which setup notification for it
         //
         ....
   }

   create_tcp_client()
   {
           client = create_client() // instantiate client data structure
           ....... // finalize client initialization
           status = db_start_events ( client->evuser, "CAS-event", NULL, NULL, priorityOfEvents ); // fork event_task() thread
           .......
   }

   event_task()
   {
          while (not finished) {
               wait for PV value changes
               notify client about the change;
          }
   }

   event_add_action (..... struct client *client)
   {
          // this function setup notification for individual client

         <<<==== at this place a callback function would be appreciate to inform epics server application someone has started to
                             listen to PV changes
   }

summary: - notify server application about new camonitor client
+ ENHANCEMENT REQUEST: notify server application about new camonitor
+ client
Revision history for this message
Andrew Johnson (anj) wrote :

The rsrv code does not provide a documented public API — it is too tightly coupled into the IOC database to easily use it with other software. We have not been putting any effort into this code in recent years and some time in the future it may be replaced, but if you would like to develop a patch to implement what you're suggesting and explain what you are using it for we will consider merging it.

Changed in epics-base:
importance: Undecided → Wishlist
Revision history for this message
mdavidsaver (mdavidsaver) wrote :

Record support code can achieve a somewhat similar effect by testing ellCount(&prec->mlis)==0 to find if there are any active subscriptions for that record's fields. There are also games to be played with the 3.15 server side plugins.

I agree with Andrew that RSRV is not the place to do this. If anything it should be a new record support function, but issues of compatibility, and the coupling with dbEvent which would be necessary to make this work, would be ugly. Absent a compelling use case I don't thing this should be done.

Changed in epics-base:
assignee: nobody → mdavidsaver (mdavidsaver)
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.