Michael Davidsaver 56d3b9b4e0 start
2015-09-08 17:06:31 -04:00
2015-09-08 17:06:31 -04:00
2015-09-08 17:06:31 -04:00
2015-09-08 17:06:31 -04:00
2015-09-08 17:06:31 -04:00
2015-09-08 17:06:31 -04:00

PV Access to PV Access protocol gateway (aka. proxy)

Theory of Operation

The GW maintains a Channel Cache, which is a dictionary of client side channels (shared_ptrepics::pvAccess::Channel instances) in the NEVER_CONNECTED or CONNECTED states.

Each entry also has an activity flag and reference count.

The activity flag is set each time the server side receives a search request for a PV.

The reference count is incremented for each active server side channel.

Periodically the cache is iterated and any client channels with !activity and count==0 are dropped. In addition the activity flag is unconditionally cleared.

Name search handling

The server side listens for name search requests. When a request is received the channel cache is searched. If no entry exists, then one is created and no further action is taken. If an entry exists, but the client channel is not connected, then it's activiy flag is set and no further action is taken. If a connected entry exists, then an affirmative response is sent to the requester.

When a channel create request is received, the channel cache is checked. If no connected entry exists, then the request is failed.

Structure associations

ServerChannelProvider 1->1 ChannelCache (composed)

ChannelCache 1->N ChannelCacheEntry (map<shared_ptr >) ChannelCache :: cacheLock

ChannelCacheEntry 1->1 ChannelCache (C*) ChannelCacheEntry 1->1 Channel (PVA Client) (shared_ptr)

Channel (PVA Client) 1->1 CRequester (shared_ptr) Channel :: lock

CRequester 1->1 ChannelCacheEntry (weak_ptr)

ChannelCacheEntry 1->N GWChannel (std<C*>)

GWChannel 1->1 ChannelCacheEntry (shared_ptr)

ServerChannelRequesterImpl::channelStateChange() - placeholder, needs implementation

Languages
C++ 97.3%
Makefile 1.6%
C 0.8%
Batchfile 0.3%