pvac Add ConnectEvent::peerName

This commit is contained in:
Michael Davidsaver
2019-03-11 16:28:50 -07:00
parent 663146f2e7
commit ea149f6292
2 changed files with 6 additions and 0 deletions

View File

@@ -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 {

View File

@@ -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