update transportRegistry

avoid leaks of SOCKET and leaving mutex locked
when exceptions are thrown.
This commit is contained in:
Michael Davidsaver
2018-02-01 18:54:25 -08:00
parent 5a86835a6f
commit 58f996fd98
14 changed files with 278 additions and 298 deletions

View File

@@ -16,10 +16,8 @@ namespace epics {
namespace pvAccess {
BeaconHandler::BeaconHandler(Context::shared_pointer const & context,
std::string const & protocol,
const osiSockAddr* responseFrom) :
_context(Context::weak_pointer(context)),
_protocol(protocol),
_responseFrom(*responseFrom),
_mutex(),
_serverGUID(),
@@ -88,7 +86,7 @@ bool BeaconHandler::updateBeacon(int8 /*remoteTransportRevision*/, TimeStamp* /*
void BeaconHandler::changedTransport()
{
TransportRegistry::transportVector_t transports;
_context.lock()->getTransportRegistry()->get(_protocol, &_responseFrom, transports);
_context.lock()->getTransportRegistry()->toArray(transports, &_responseFrom);
// notify all
for (TransportRegistry::transportVector_t::iterator iter(transports.begin()), end(transports.end());