Code Review
/
govpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Optimizations for statsclient
[govpp.git]
/
core
/
connection.go
diff --git
a/core/connection.go
b/core/connection.go
index
8b8c7b1
..
6f82616
100644
(file)
--- a/
core/connection.go
+++ b/
core/connection.go
@@
-89,7
+89,6
@@
type ConnectionEvent struct {
// Connection represents a shared memory connection to VPP via vppAdapter.
type Connection struct {
vppClient adapter.VppAPI // VPP binary API client
// Connection represents a shared memory connection to VPP via vppAdapter.
type Connection struct {
vppClient adapter.VppAPI // VPP binary API client
- //statsClient adapter.StatsAPI // VPP stats API client
maxAttempts int // interval for reconnect attempts
recInterval time.Duration // maximum number of reconnect attempts
maxAttempts int // interval for reconnect attempts
recInterval time.Duration // maximum number of reconnect attempts
@@
-177,7
+176,9
@@
func (c *Connection) connectVPP() error {
log.Debugf("Connected to VPP")
if err := c.retrieveMessageIDs(); err != nil {
log.Debugf("Connected to VPP")
if err := c.retrieveMessageIDs(); err != nil {
- c.vppClient.Disconnect()
+ if err := c.vppClient.Disconnect(); err != nil {
+ log.Debugf("disconnecting vpp client failed: %v", err)
+ }
return fmt.Errorf("VPP is incompatible: %v", err)
}
return fmt.Errorf("VPP is incompatible: %v", err)
}
@@
-192,7
+193,6
@@
func (c *Connection) Disconnect() {
if c == nil {
return
}
if c == nil {
return
}
-
if c.vppClient != nil {
c.disconnectVPP()
}
if c.vppClient != nil {
c.disconnectVPP()
}