Commit Graph

1612 Commits

Author SHA1 Message Date
Michael Davidsaver
8644f4230d client: simplify monitor type handling
I think the original logic is correct, but I'm not sure.
Cleverness to avoiding storing a Structure pointer is a
premature optimization anyway.
2018-07-15 19:22:43 -07:00
Michael Davidsaver
99f68dac04 monitorfifo better default config handling 2018-07-14 15:06:44 -07:00
Michael Davidsaver
f4b245710d sharedstate: Get use pvRequest field selection mask 2018-07-14 15:00:15 -07:00
Michael Davidsaver
2912112419 MonitorFIFO use pvRequest field selection mask 2018-07-14 15:00:15 -07:00
Michael Davidsaver
bf8b0bde16 quiet warning 2018-07-14 13:58:00 -07:00
Michael Davidsaver
e29cda2a74 sharedstate: missed a reftrack 2018-07-11 18:14:54 -07:00
Michael Davidsaver
512cc11923 client: avoid race during monitor shutdown
poll() vs. cancel()
2018-07-09 15:19:52 -07:00
Bruno Martins
3caea5991a Fix PutCallback type comparison. Fix #112 2018-07-09 08:59:51 -07:00
Michael Davidsaver
1a459d75d5 dllimport/export part 4 2018-07-06 16:00:33 -07:00
Michael Davidsaver
c61dad10c8 dllimport/export part 3 2018-07-06 15:33:40 -07:00
Michael Davidsaver
77b4934966 dllimport/export part 2 2018-07-06 14:59:29 -07:00
Michael Davidsaver
39e6e443aa dllimport/export part 1 2018-07-06 14:41:32 -07:00
Michael Davidsaver
93dc0f4f1a drop unused 2018-07-06 11:20:34 -07:00
mdavidsaver
ab696f00b6 Merge pull request #111 from mdavidsaver/sharedpv
Include SharedPV et al.
2018-07-06 11:20:13 -07:00
Michael Davidsaver
59a65ce317 discoverInterfaces() fixup bcast address on win32
Apparently SIO_GET_INTERFACE_LIST sometimes gives
the global broadcast (255.255.255.255) for one of
the interfaces.  In this case silently compute
the iface bcast address.
2018-07-02 18:54:05 -07:00
Michael Davidsaver
7912718664 discoverInterfaces() compat RTEMS 2018-07-02 15:32:10 -07:00
Michael Davidsaver
b97e37da98 de-duplicate address lists 2018-07-02 14:50:24 -07:00
Michael Davidsaver
fc037f0a39 drop getBroadcastAddresses()
in favor of discoverInterfaces().

if we have to do NIC discovery ourselves, then at least
avoid mixing our results with the similar, but not identical
results of osiSockDiscoverBroadcastAddresses() from Base.
2018-07-02 14:39:37 -07:00
Michael Davidsaver
2d5ba15095 pvlist replace getBroadcastAddresses() with discoverInterfaces() 2018-07-02 14:39:36 -07:00
Michael Davidsaver
beb977bd78 revise address list expansion 2018-07-02 14:39:36 -07:00
Michael Davidsaver
c5419f9487 revise discoverInterfaces()
change interface to distingush between bcast and point2point.
add netmask to truly distinguish unicast from bcast.
fix some minor (I think) errors in the bsd socks impl (use of clobbered buffer).
cleanup win32 impl. bcast and p2p handling.
2018-07-02 14:39:36 -07:00
Michael Davidsaver
53a63f9a1f inetAddressUtil: save ifr_addr before query of IFFLAGS
Save before later calls clobber the buffer (was corrupting
sin_family).
2018-07-02 14:39:36 -07:00
Michael Davidsaver
74c2ec1ec3 Add SharedPV 2018-06-29 16:55:27 -07:00
Michael Davidsaver
ccb1d1dbe3 missing include 2018-06-29 16:55:27 -07:00
Michael Davidsaver
146fbbc719 add pva/server.h 2018-06-29 16:55:27 -07:00
Michael Davidsaver
c93f7a35f7 pva/client.h: no lastRequest()
until #97 is resolved.  Avoids annoying message.

https://github.com/epics-base/pvAccessCPP/issues/97
2018-06-29 16:22:57 -07:00
Michael Davidsaver
135f66393d pva/client.h: Get expose valid bitset
turns out this is useful after all.
2018-06-29 16:22:57 -07:00
Michael Davidsaver
80db41f1c4 pva/client.h Allow callbacks to unref Operations
Keep a local (internal) shared_ptr whenever
user callbacks are run.  This allows user
callbacks to drop (reset()/dtor) Operations
or Monitors safely.

Ref must to captured before mutex is locked,
which is safe as the internal weak_ptr is
not changed after build() (despite being non-const)
2018-06-29 16:22:57 -07:00
Michael Davidsaver
f29ef3121e pvtools: compose pvutil_ostream
eliminate at least some of the odd-ness which is causing
build failures on hosted mingw.
2018-06-29 16:22:56 -07:00
Michael Davidsaver
a1a2e71ecc fix ServerCancelRequestHandler::handleResponse
Thus far this has been dead code as ServerChannel::getRequest()
returned a Destroyable which was actually a BaseChannelRequester
sub-class, not a ChannelRequest sub-class.
2018-06-29 16:22:56 -07:00
Michael Davidsaver
3ffbf9c597 ServerChannel::_requests holds BaseChannelRequester
Make it a bit more obvious that things are backwards here.
2018-06-29 16:22:56 -07:00
Michael Davidsaver
3341d9a2ba spamme example use MonitorFIFO 2018-06-26 19:06:47 -07:00
Michael Davidsaver
5e887a6d02 add MonitorFIFO 2018-06-26 19:06:47 -07:00
Michael Davidsaver
1e04c91d3c Server window fix clear
A leftover from when window_t held MonitorElement::Ref
which it no longer does.
2018-06-26 11:56:51 -07:00
Michael Davidsaver
c0126d9a1c server: pipeline=true windowing
Implement flow control windows in the server itself,
so that this applies to all Monitor.

Then the reportRemoteQueueStatus() callback is only needed
to deliver the initial window update.

This is done by not calling Monitor::release() immediately
when pipeline=true.  Rather, hold onto MonitorElement s
until an ack is received.

Also addresses a race with clearing _channelMonitor
vs. having send() queued at/after destroy().
2018-06-26 11:23:50 -07:00
Michael Davidsaver
a413f8f9db add dummy ChannelFind implementation.
Since this class is not really used...
2018-06-26 11:23:50 -07:00
Michael Davidsaver
656e2fcfd4 PVA server avoid possible data race
The operation member variable is set by from the
returned pointer, and within the *Connect callback.
Make sure these down race.
2018-06-26 11:23:50 -07:00
Michael Davidsaver
4baa72c91d avoid data race
destroy() sets _serverSocketChannel=INVALID_SOCKET under the lock.
Other changes are made before the worker thread starts.
2018-06-26 10:45:14 -07:00
Michael Davidsaver
1ba48868f6 PVA server avoid lock order violation
There is a lock order violation when a server force disconnects it's clients while sending a final message to it (or concurrent close, or probably others). The entry points are channelStateChange() and operation send().

Fix is not to hold the channel mutex when destroy()ing operations.

epics::pvAccess::ServerChannelRPCRequesterImpl::destroy
  locks RPC requester mutex
epics::pvAccess::ServerChannel::destroy
  locks channel mutex
epics::pvAccess::ServerChannelRequesterImpl::channelStateChange


epics::pvAccess::ServerChannel::unregisterRequest
  locks channel mutex
epics::pvAccess::ServerChannelRPCRequesterImpl::destroy
  locks RPC requester mutex
epics::pvAccess::ServerChannelRPCRequesterImpl::send
2018-06-25 19:52:10 -07:00
Michael Davidsaver
4b3237a20d BlockingUDPTransport::enqueueSendRequest cleanup?
oh my was this bad code!  It isn't clear what
lock()/unlock() are guarding, but let them
continue as before, but don't swallow any exception,
or unlock twice.
2018-06-22 13:28:49 -07:00
Michael Davidsaver
d424202323 client: exception propagation from callbacks
Swallowing exceptions here hides some of our errors.
Particularly unrecoverable introspectionRegistry misses.
Instead, propagate up to Thread and close connection.
2018-06-22 13:28:49 -07:00
Michael Davidsaver
1670ff8f7c SerializationHelper cleanup and add error checks 2018-06-22 13:28:49 -07:00
Michael Davidsaver
3abd77a42c fix IntrospectionRegistry error handling
Calling code can't deal with "cache" miss,
which indicates either a protocol error (use of invalid ID),
or a logic error on our part (didn't save ID).
In either case, better to throw an exception than to crash.
2018-06-22 13:28:49 -07:00
Michael Davidsaver
e08de8c2df detect Structure caching error
The assert in the client side copy is hit during
some kind of failure to keep the Field cache
up to date.
2018-06-22 13:28:49 -07:00
Michael Davidsaver
de6586b92f MonitorElement::Ref swap() and move, but no copy 2018-06-05 09:32:22 -07:00
Michael Davidsaver
578dbc9456 add another ChannelProviderRegistry::addSingleton() overload
Construct a "factory" around a pre-allocated instance.
2018-06-05 09:32:22 -07:00
Michael Davidsaver
8000ed0637 client.h default ctor for ClientProvider
Allow an invalid ClientProvider to be created
for later assignment.
2018-06-05 09:32:22 -07:00
Michael Davidsaver
c8292caf91 remote: Request larger stack for workers
Overflows observed on RTEMS/ppc (mvme6100).
2018-06-04 10:08:01 -07:00
Michael Davidsaver
794d72ba6b client.h MonitorSync missing init of member 2018-06-04 10:08:01 -07:00
Michael Davidsaver
44132be716 avoid MSVC min()/max() conflict 2018-05-28 10:19:48 -07:00