From 9d780b0fdd07494e89cfd23fbb87b00e66000e1c Mon Sep 17 00:00:00 2001
From: Jeff Hill
The CA client library will continuously attempt to connect any CA channels -that an application has created until it is successful. The CA client library +that an application has created until it is successful. The library periodically queries the server destination address list described above with name resolution requests for any unresolved channels. Since this address list frequently contains broadcast addresses, and because nonexistent process @@ -494,11 +495,11 @@ operating system - whichever is greater. The number of UDP frames per interval is also dynamically adjusted based on the past success rate.
If name resolution requests are not responded to, then the client library -doubles the delay between name resolution attempts with each attempt -eventually limited by a maxuimum plateau interval, and it also reduces the -number of requests per interval. After some long interval, if the client -library does not receive any responses it stops sending name resolution -attempts altogether until it sees a beacon anomaly.
+doubles the delay between name resolution attempts and reduces the number of +requests per interval. The delay between attempts is initially limited by a +maxuimum however, after some long interval, if the client library does not +receive any responses it stops sending name resolution attempts altogether +until it sees a beacon anomaly.The CA client library continually estimates the beacon period of all server beacons received. If a particular server's beacon period becomes @@ -972,31 +973,35 @@ int main ( int argc, char ** argv )
Certain CA client initiated requests asynchronously execute an application -supplied call back in the client when a response arrives. The functions -ca_put_callback, ca_get_callback, and ca_add_event all request notification -of asynchronous completion via this mechanism. The structure -"event_handler_args" is passed to the application supplied callback. In this -structure the field "dbr" is a void pointer to any data that might be -returned. The field "status" will be set to one of the CA error codes in -caerr.h and will indicate the status of the operation performed in the IOC. -If the status field isn't set to ECA_NORMAL or data isn't normally returned -from the operation (i.e. put call back) then you should expect that the field -"dbr" will be set to NULL. The fields "usr", "chid", and "type" are set to -the values specified when the request was made by the application.
-struct event_handler_args {
- void *usr; /* user argument supplied when event added */
- chid chid; /* channel id */
- long type; /* dbr type of the value returned */
- long count; /* element count of the item(s) returned */
- const void *dbr; /* pointer to the value returned */
- int status; /* ECA_XXX status of the op from server */
-};
+supplied call back in the client process when a response arrives. The
+functions ca_put_callback, ca_get_callback, and ca_add_event all request
+notification of asynchronous completion via this mechanism. The
+event_handler_args structure is passed by value to the
+application supplied callback. In this structure the dbr field
+is a void pointer to any data that might be returned. The
+status field will be set to one of the CA error
+codes in caerr.h and will indicate the status of the operation performed in
+the IOC. If the status field isn't set to ECA_NORMAL or data isn't normally
+returned from the operation (i.e. put call back) then you should expect that
+the dbr field will be set to a nill pointer (zero). The fields
+usr, chid, and type are set to the
+values specified when the request was made by the application.
+typedef struct event_handler_args {
+ void *usr; /* user argument supplied with request */
+ chanId chid; /* channel id */
+ long type; /* the type of the item returned */
+ long count; /* the element count of the item returned */
+ const void *dbr; /* a pointer to the item returned */
+ int status; /* ECA_XXX status of the requested op from the server */
+} evargs;
void myCallback ( struct event_handler_args args )
{
- if ( type == DBR_TIME_DOUBLE ) {
- const struct dbr_time_double * pTD =
- ( const struct dbr_time_double * ) args.dbr;
+ if ( args.status != ECA_NOEMAL ) {
+ }
+ if ( args.type == DBR_TIME_DOUBLE ) {
+ const struct dbr_time_double * pTD =
+ ( const struct dbr_time_double * ) args.dbr;
}
}
@@ -1141,6 +1146,11 @@ int ca_context_create ( enum ca_preemptive_callback_select SELECT );This function should be called once prior to making any of the other
channel access calls.
+If ca_disable_preemptive_callback is specified then
+additional threads are not allowed to join the CA context using
+ca_context_attach() because allowing other threads to join implies that CA
+callbacks will be called preemptively from more than one thread.
SELECTIf ca_disable_preemptive_callback is specified then
-additional threads are not allowed to join the CA context using
-ca_context_attach() because allowing other threads to join implies that CA
-callbacks will be called preemptively from more than one thread.
See caExample.c in the example application created by makeBaseApp.pl.
@@ -1263,7 +1268,19 @@ callbacks will be called preemptively from more than one thread.The following structure is passed by value to the user's
+ connection connection callback function. The op field will
+ be set by the CA client library to CA_OP_CONN_UP when the
+ channel connects, and to CA_OP_CONN_DOWN when the channel
+ disconnects. See ca_puser if the
+ PUSER argument is required in your callback
+ handler.
struct ca_connection_handler_args {
+ chanId chid; /* channel id */
+ long op; /* one of CA_OP_CONN_UP or CA_OP_CONN_DOWN */
+};
+
PUSERPFUNCUSERARGUSERFUNCUSERARGUSRERFUNCUSERARGReplace the currently installed exception handler call back.
+Replace the currently installed CA context global exception handler call +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 @@ -1892,9 +1910,25 @@ field should not be used.
USERFUNCop field can be one of
+ CA_OP_GET, CA_OP_PUT, CA_OP_CREATE_CHANNEL, CA_OP_ADD_EVENT,
+ CA_OP_CLEAR_EVENT, or CA_OP_OTHER.
+ struct exception_handler_args {
+ void *usr; /* user argument supplied when installed */
+ chanId chid; /* channel id (may be nill) */
+ long type; /* type requested */
+ long count; /* count requested */
+ void *addr; /* user's address to write results of CA_OP_GET */
+ long stat; /* channel access ECA_XXXX status code */
+ long op; /* CA_OP_GET, CA_OP_PUT, ..., CA_OP_OTHER */
+ const char *ctx; /* a character string containing context info */
+ sonst char *pFile; /* source file name (may be NULL) */
+ unsigned lineNo; /* source file line number (may be zero) */
+};
+ USERARGECA_NORMAL - Normal successful completion
-ca_replace_printf_handler ()ca_replace_printf_handler
+()#include <cadef.h>
typedef int caPrintfFunc ( const char *pFromat, va_list args );
int ca_replace_printf_handler ( caPrintfFunc *PFUNC );
@@ -1958,17 +1993,18 @@ SEVCHK ( status, "failed to install my printf handler" );
ECA_NORMAL - Normal successful completion
-ca_replace_access_rights_event()ca_replace_access_rights_event()#include <cadef.h>
typedef void ( *pCallBack )( struct access_rights_handler_args );
-int ca_replace_access_rights_event ( chid CHAN, pCallBack PFUNC );
+int ca_replace ( chid CHAN, pCallBack PFUNC );
Install or replace the access rights state change call back handler for -the specified channel.
+Install or replace the access rights state change callback handler for the +specified channel.
-The call back handler is called in the following situations.
+The callback handler is called in the following situations.
PFUNCtypedef struct ca_access_rights {
+ unsigned read_access:1;
+ unsigned write_access:1;
+} caar;
+
+/* arguments passed to user access rights handlers */
+struct access_rights_handler_args {
+ chanId chid; /* channel id */
+ caar ar; /* new access rights state */
+};
+