From ef471318d66dd2832df4dc929d312f7cd5f7009a Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Wed, 26 Jun 2019 16:28:20 +0200 Subject: Improvements for binapi-generator and support VPP 19.04 in statsclient - RPC service client implementation for dumps requests now streams responses - RPC service generation is now enabled by default - examples now allow setting binapi socket address - input dir flag for binapi-generator will recursively look into dirs to support core/plugins in /usr/share/vpp/api - minor improvements in debug logs - add support for VPP 19.04 for statsclient Change-Id: I0939ee3aa6e9f850d073fc5c87aff4ccc56b0d70 Signed-off-by: Ondrej Fabry --- core/connection.go | 10 +++++++--- core/log.go | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/connection.go b/core/connection.go index 67c7e1d..02f980a 100644 --- a/core/connection.go +++ b/core/connection.go @@ -174,8 +174,7 @@ func (c *Connection) connectVPP() error { if err := c.vppClient.Connect(); err != nil { return err } - - log.Debugf("Connected to VPP.") + log.Debugf("Connected to VPP") if err := c.retrieveMessageIDs(); err != nil { c.vppClient.Disconnect() @@ -202,7 +201,12 @@ func (c *Connection) Disconnect() { // disconnectVPP disconnects from VPP in case it is connected. func (c *Connection) disconnectVPP() { if atomic.CompareAndSwapUint32(&c.vppConnected, 1, 0) { - c.vppClient.Disconnect() + log.Debug("Disconnecting from VPP..") + + if err := c.vppClient.Disconnect(); err != nil { + log.Debugf("Disconnect from VPP failed: %v", err) + } + log.Debug("Disconnected from VPP") } } diff --git a/core/log.go b/core/log.go index aaef4cc..035c159 100644 --- a/core/log.go +++ b/core/log.go @@ -18,6 +18,7 @@ func init() { log.Out = os.Stdout if debug { log.Level = logger.DebugLevel + log.Debugf("debug mode enabled") } } -- cgit 1.2.3-korg