From ea149f62926107cfbb6533541fc027b35f17a636 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 11 Mar 2019 16:28:50 -0700 Subject: [PATCH] pvac Add ConnectEvent::peerName --- src/client/client.cpp | 2 ++ src/client/pva/client.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/client/client.cpp b/src/client/client.cpp index dd2373a..a33cf19 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -77,6 +77,8 @@ struct ClientChannel::Impl : public pva::ChannelRequester, try { ConnectEvent evt; evt.connected = connectionState==pva::Channel::CONNECTED; + if(evt.connected) + evt.peerName = channel->getRemoteAddress(); for(listeners_t::const_iterator it=notify.begin(), end=notify.end(); it!=end; ++it) { try { diff --git a/src/client/pva/client.h b/src/client/pva/client.h index 89c3a74..9578fb4 100644 --- a/src/client/pva/client.h +++ b/src/client/pva/client.h @@ -232,7 +232,11 @@ private: //! information on connect/disconnect struct ConnectEvent { + //! Is this a connection, or disconnection, event. bool connected; + //! For connection events. This is the name provided by the peer (cf. epics::pvAccess::Channel::getRemoteAddress() ). + //! @since >6.1.0 + std::string peerName; }; //! Thrown by blocking methods of ClientChannel on operation timeout