Here's the original message I sent with the motivation for this change. Subject: [PATCH 0/4] Adding dynamic arrays to EPICS Channel Access Following on from last week's EPICS codeathon at Diamond I have prepared the attached series of patches for review. The basic idea is to extend the server's understanding of the EPICS CA protocol with one further idea: a request for a zero length array is interpreted as, instead, a request for an autoresizing array, where the server sends the true "intrinsic" length of the data with each update. The motivation is to efficiently support the handling of large waveforms such as images or long oscilloscope waveforms, where it is undesirable to have to always send the entire data. There are workarounds involving monitoring the .NORD field and resubscribing on changes, but I believe the approach described here is preferable. Also, this new functionality opens up the possiblity of sending complex structured data of unpredictable length packaged as EPICS waveforms -- something that has already been started with support for long strings. It turns out that the implementation of this extension is reasonably straightforward and that EPICS is mostly already ready for it. The following detailed changes are implemented: * A zero length Data Count in a CA_PROTO_EVENT_ADD or CA_PROTO_READ message is now interpreted so that the "intrinsic" data count is sent in all replies. A new minor protocol version, V4.12, is defined to enable this behaviour. * When processing the request for dynamically sized data the server is able to make use of two items of information for each value: its dynamic size, as returned by dbGetField(), and its maximum field size, as stored in the no_elements field of the associated dbAddr structure. * The channel access client now passes through a zero length request to the server (if the server reports minor protocol >= 4.12), and the true data size is now reported in the associated callbacks. This means that ca_array_get_callback and ca_create_subscription may now receive variable size updates in response to a zero length request count. I have also updated the caget and camonitor tools to support this new functionality. The attached patches are based on bzr revision 12070. Michael Abbott (4): Client side support for automatic resizing arrays. Update rsrv to support V4.12 protocol extension. Add autosizing array support for caget and camonitor. Drive-by refactoring in caserverio.c src/ca/caProto.h | 3 + src/ca/db_access.h | 6 +- src/ca/nciu.cpp | 3 - src/ca/nciu.h | 3 +- src/ca/netIO.h | 6 +- src/ca/oldChannelNotify.cpp | 3 + src/ca/tcpiiu.cpp | 11 +- src/catools/caget.c | 30 ++-- src/catools/camonitor.c | 11 +- src/catools/tool_lib.c | 6 +- src/catools/tool_lib.h | 4 +- src/db/db_access.c | 345 +++++++++++-------------------------------- src/db/db_access_routines.h | 3 + src/rsrv/camessage.c | 85 ++++++----- src/rsrv/caserverio.c | 55 ++++--- src/rsrv/server.h | 3 +- 16 files changed, 214 insertions(+), 363 deletions(-)