If the subscription update producer in the server produces subscription
+updates faster than the subscription update consumer in the client consumes
+them, then events have to be discarded if the buffering in the server
+isn’t allowed to grow to an infinite size. This is a law of nature
+– based on queuing theory of course.
+
+What is done depends on the version of the CA server. All server versions
+place quotas on the maximum number of subscription updates allowed on the
+subscription update queue at any given time. If this limit is reached, an
+intervening update is discarded in favor of a more recent update. Depending
+on the version of the server, rapidly updating subscriptions are or are not
+allowed to cannibalize the quotas of slow updating subscriptions in limited
+ways. Nevertheless, there is always room on the queue for at least one update
+for each subscription. This guarantees that the most recent update is always
+sent.
+
+Adding further complication, the CA client library also implements a
+primitive type of flow control. If the client library sees that it is reading
+a large number of messages one after another w/o intervening delay it knows
+that it is not consuming events as fast as they are produced. In that
+situation it sends a message telling the server to temporarily stop sending
+subscription update messages. When the client catches up it sends another
+message asking the server to resume with subscription updates. This prevents
+slow clients from getting time warped, but also guarantees that intervening
+events are discarded until the slow client catches up.
+
+There is currently no message on the IOC’s console when a
+particular client is slow on the uptake. A message of this type used to exist
+many years ago, but it was a source of confusion (and what we will call
+message noise) so it was removed.
+
+There is unfortunately no field in the protocol allowing the server to
+indicate that an intervening subscription update was discarded. We should
+probably add that capability in a future version. Such a feature would, for
+example, be beneficial when tuning an archiver installation.
+
When the server detects a failure, and there is no client call back
-function attached to the request, then an exception handler is executed
-in the client. The default exception handler prints a message on the console
-and exits if the exception condition is severe. Certain internal exceptions
+function attached to the request, then an exception handler is executed in
+the client. The default exception handler prints a message on the console and
+exits if the exception condition is severe. Certain internal exceptions
within the CA client library, and failures detected by the SEVCHK macro may
also cause the exception handler to be invoked. To modify this behavior see
ca_add_exception_event().
@@ -2039,15 +2087,15 @@ by the CA library functions that request them.
For routines that require an argument specifying the number of array
-elements, no more than the process variable's maximum native
-element count may be requested. The process variable's maximum native
-element count is available from ca_element_count() when the channel is
-connected. If less elements than the process variable's native element count
-are requested the requested values will be fetched beginning at element zero.
-By default CA limits the number of elements in an array to be no more than
-approximately 16k divided by the size of one element in the array. Starting
-with EPICS R3.14 the maximum array size may be configured in the client and
-in the server.
+elements, no more than the process variable's maximum native element count
+may be requested. The process variable's maximum native element count is
+available from ca_element_count() when the channel is connected. If less
+elements than the process variable's native element count are requested the
+requested values will be fetched beginning at element zero. By default CA
+limits the number of elements in an array to be no more than approximately
+16k divided by the size of one element in the array. Starting with EPICS
+R3.14 the maximum array size may be configured in the client and in the
+server.
Shut down a channel access client context and free any resources
allocated.
On many OS that execute programs in a process based environment the
@@ -2329,9 +2377,9 @@ call that operates on a channel.
The circuit may be initially connected or disconnected depending on the
state of the network and the location of the channel. A channel will
-only enter a connected state after server's address is determined,
-and only if channel access successfully establishes a virtual circuit through
-the network to the server. Channel access routines that send a request to a
+only enter a connected state after server's address is determined, and only
+if channel access successfully establishes a virtual circuit through the
+network to the server. Channel access routines that send a request to a
server will return ECA_DISCONNCHID if the channel is currently
disconnected.
@@ -2369,9 +2417,9 @@ any time.
PRIORITY
@@ -2436,7 +2484,7 @@ int ca_clear_channel (chid CHID);
Description
-Shutdown and reclaim resources associated with a channel created by
+
Shutdown and reclaim resources associated with a channel created by
ca_create_channel().
All remote operation requests such as the above are accumulated (buffered)
@@ -2446,7 +2494,7 @@ efficiently sent over the network in one message.
Clearing a channel does not cause its disconnect handler to be called, but
clearing a channel does shutdown and reclaim any channel state change event
-subscriptions (monitors) registered with the channel.
+subscriptions (monitors) registered with the channel.
Arguments
@@ -2480,17 +2528,17 @@ int ca_array_put_callback ( chtype TYPE,
Write a scalar or array value to a process variable.
-When ca_array_put or ca_put are invoked the client will receive no
+
When ca_array_put or ca_put are invoked the client will receive no
response unless the request can not be fulfilled in the server. If
unsuccessful an exception handler is run on the client side. If a connection
-is lost and then resumed outstanding ca_array_put or ca_put
-requests are not automatically reissued following reconnect, and no
-additional notification are provided to the user for each put request.
+is lost and then resumed outstanding ca_array_put or ca_put requests are
+not automatically reissued following reconnect, and no additional
+notification are provided to the user for each put request.
When ca_array_put_callback are invoked the user supplied asynchronous call
-back is called only after the initiated write operation and all actions
-resulting from the initiating write operation complete. If unsuccessful
-the call back function is invoked indicating bad status. If the channel
+back is called only after the initiated write operation and all actions
+resulting from the initiating write operation complete. If unsuccessful the
+call back function is invoked indicating bad status. If the channel
disconnects before a put callback request can be completed, then the client's
call back function is called with bad status, but this does not guarantee
that the server did not receive and process the request before the
@@ -2527,8 +2575,8 @@ message.
PFUNC
- - address of user supplied callback function
- to be run when the requested operation completes
+ - address of user supplied callback function to be
+ run when the requested operation completes
USERARG
@@ -2581,10 +2629,10 @@ assumed to be stable in the application supplied buffer until after
ECA_NORMAL is returned from ca_pend_io. If a connection is lost outstanding
get requests are not automatically reissued following reconnect.
When ca_get_callback or ca_array_get_callback are invoked a value is read
-from the channel and then the user's callback is invoked with a pointer
-to the retrieved value. Note that ca_pend_io will not block for the delivery
-of values requested by ca_get_callback. If the channel disconnects before a
-get callback request can be completed, then the clients call back function is
+from the channel and then the user's callback is invoked with a pointer to
+the retrieved value. Note that ca_pend_io will not block for the delivery of
+values requested by ca_get_callback. If the channel disconnects before a get
+callback request can be completed, then the clients call back function is
called with bad status.
All of these functions return ECA_DISCONN if the channel is currently
@@ -2666,27 +2714,26 @@ int ca_create_subscription ( chtype TYPE,
Description
Register a state change subscription and specify a call back function to
-be invoked whenever the process variable undergoes significant
-state changes. A significant change can be a change in the process variable's
-value, alarm status, or alarm severity. In the process control function block
-database the deadband field determines the magnitude of a significant change
-for for the process variable's value. Each call to this function consumes
-resources in the client library and potentially a CA server until one of
-ca_clear_channel or ca_clear_event is called.
+be invoked whenever the process variable undergoes significant state changes.
+A significant change can be a change in the process variable's value, alarm
+status, or alarm severity. In the process control function block database the
+deadband field determines the magnitude of a significant change for for the
+process variable's value. Each call to this function consumes resources in
+the client library and potentially a CA server until one of ca_clear_channel
+or ca_clear_event is called.
-Subscriptions may be installed or canceled against both
-connected and disconnected channels. The specified USERFUNC is called once
-immediately after the subscription is installed with the process variable's
-current state if the process variable is connected. Otherwise, the specified
-USERFUNC is called immediately after establishing a connection (or
-reconnection) with the process variable. The specified USERFUNC is called
-immediately with the process variable's current state from within
-ca_add_event() if the client and the process variable share the same address
-space.
+Subscriptions may be installed or canceled against both connected and
+disconnected channels. The specified USERFUNC is called once immediately
+after the subscription is installed with the process variable's current state
+if the process variable is connected. Otherwise, the specified USERFUNC is
+called immediately after establishing a connection (or reconnection) with the
+process variable. The specified USERFUNC is called immediately with the
+process variable's current state from within ca_add_event() if the client and
+the process variable share the same address space.
-If a subscription is installed on a channel in a disconnected state
-then the requested count will be set to the native maximum element count of
-the channel if the requested count is larger.
+If a subscription is installed on a channel in a disconnected state then
+the requested count will be set to the native maximum element count of the
+channel if the requested count is larger.
All subscription requests such as the above are accumulated (buffered) and
not forwarded to the IOC until one of ca_flush_io, ca_pend_io, ca_pend_event,
@@ -2695,9 +2742,9 @@ over the network in one message.
If at any time after subscribing, read access to the specified process
variable is lost, then the call back will be invoked immediately indicating
-that read access was lost via the status argument. When read access is
+that read access was lost via the status argument. When read access is
restored normal event processing will resume starting always with at
-least one update indicating the current state of the channel.
+least one update indicating the current state of the channel.
A better name for this function might have been ca_subscribe.
@@ -2723,9 +2770,8 @@ least one update indicating the current state of the channel.
USRERFUNC
- - The address of user supplied
- callback function to be invoked with each subscription
- update.
+ - The address of user supplied callback function to
+ be invoked with each subscription update.
USERARG
@@ -2741,8 +2787,7 @@ least one update indicating the current state of the channel.
PEVID
- This is a pointer to user supplied event id which is overwritten if
successful. This event id can later be used to clear a specific
- event. This option may may be omitted by passing a nil
- pointer.
+ event. This option may may be omitted by passing a nil pointer.
MASK
@@ -2790,7 +2835,7 @@ int ca_clear_subscription ( evid EVID );
Cancel a subscription.
All ca_clear_event() requests such as the above are accumulated (buffered)
-and not forwarded to the server until one of ca_flush_io, ca_pend_io,
+and not forwarded to the server until one of ca_flush_io, ca_pend_io,
ca_pend_event, or ca_sg_pend are called. This allows several requests to be
efficiently sent together in one message.
@@ -2827,19 +2872,18 @@ time.
If ECA_TIMEOUT is returned then get requests may be reissued followed by a
-subsequent call to ca_pend_io(). Specifically, the function will
-block only for outstanding ca_get requests issued,
-and also any channels created specifying a nill connection handler function
-pointer, after the last call to ca_pend_io() or ca client context creation
-whichever is later. Note that ca_create_channel requests generally should not
-be reissued for the same process variable unless ca_get requests issued, and also any
+channels created specifying a nill connection handler function pointer, after
+the last call to ca_pend_io() or ca client context creation whichever is
+later. Note that ca_create_channel requests
+generally should not be reissued for the same process variable unless ca_clear_channel is called first.
If no ca_get or connection state change events are
outstanding then ca_pend_io() will flush the send buffer and return
-immediately without processing any outstanding channel access
-background activities.
+immediately without processing any outstanding channel access background
+activities.
The delay specified to ca_pend_io() should take into account worst case
network delays such as Ethernet collision exponential back off until
@@ -2853,7 +2897,7 @@ are pending.
- TIMEOUT
- Specifies the time out interval. A
TIMEOUT interval of
- zero specifies forever.
+ zero specifies forever.
Returns
@@ -2878,13 +2922,12 @@ int ca_test_io();
Description
-This function tests to see if all ca_get
-requests are complete and channels created specifying a nill connection
-callback function pointer are connected. It will report the status of
-outstanding ca_get requests issued, and channels
-created specifying a nill connection callback function pointer, after the
-last call to ca_pend_io() or CA context initialization whichever is
-later.
+This function tests to see if all ca_get requests
+are complete and channels created specifying a nill connection callback
+function pointer are connected. It will report the status of outstanding ca_get requests issued, and channels created specifying a
+nill connection callback function pointer, after the last call to
+ca_pend_io() or CA context initialization whichever is later.
Returns
@@ -2940,10 +2983,9 @@ int ca_flush_io();
Description
-Flush outstanding IO requests to the server. This routine might
-be useful to users who need to flush requests prior
-to performing client side labor in parallel with labor performed in the
-server.
+Flush outstanding IO requests to the server. This routine might be useful
+to users who need to flush requests prior to performing client side labor in
+parallel with labor performed in the server.
Outstanding requests are also sent whenever the buffer which holds them
becomes full.
@@ -2985,7 +3027,7 @@ for this purpose.
CONTEXT_STRING
- - A null terminated character string to supply as error context to
+
- A null terminated character string to supply as error context to
diagnostics.
@@ -3006,10 +3048,10 @@ back.
When an error occurs in the server asynchronous to the clients thread then
information about this type of error is passed from the server to the client
-in an exception message. When the client receives this exception message
-an exception handler callback is called.The default exception handler prints
-a diagnostic message on the client's standard out and terminates
-execution if the error condition is severe.
+in an exception message. When the client receives this exception message an
+exception handler callback is called.The default exception handler prints a
+diagnostic message on the client's standard out and terminates execution if
+the error condition is severe.
Note that certain fields in "struct exception_handler_args" are not
applicable in the context of some error messages. For instance, a failed get
@@ -3124,7 +3166,7 @@ specified channel.
When a channel is created no access rights handler is installed.
+When a channel is created no access rights handler is installed.