From e6cca4bfd215aba51d58bf0bb046c16c081e42a3 Mon Sep 17 00:00:00 2001 From: Vladimir Lavor Date: Thu, 4 Apr 2019 14:36:34 +0200 Subject: [PATCH] fix govpp, add more checks to makefile Change-Id: Ie118b0c254e5d70e66d5cb4a5f6eb8fa852f0ed8 Signed-off-by: Vladimir Lavor --- Makefile | 2 +- examples/simple-client/simple_client.go | 2 +- govpp.go | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e5ae92e..c4b742e 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ examples: test: @echo "=> running tests" go test -cover ./cmd/... - go test -cover ./core ./api ./codec + go test -cover ./ ./adapter ./core ./api ./codec extras: @echo "=> building extras" diff --git a/examples/simple-client/simple_client.go b/examples/simple-client/simple_client.go index 6429c35..a494e81 100644 --- a/examples/simple-client/simple_client.go +++ b/examples/simple-client/simple_client.go @@ -35,7 +35,7 @@ func main() { fmt.Println("Starting simple VPP client...") // connect to VPP - conn, conev, err := govpp.AsyncConnect("") + conn, conev, err := govpp.AsyncConnect("", core.DefaultMaxReconnectAttempts, core.DefaultReconnectInterval) if err != nil { log.Fatalln("ERROR:", err) } diff --git a/govpp.go b/govpp.go index f679242..d66d5dc 100644 --- a/govpp.go +++ b/govpp.go @@ -18,6 +18,7 @@ import ( "git.fd.io/govpp.git/adapter" "git.fd.io/govpp.git/adapter/vppapiclient" "git.fd.io/govpp.git/core" + "time" ) var ( @@ -49,6 +50,6 @@ func Connect(shm string) (*core.Connection, error) { // This call does not block until connection is established, it returns immediately. The caller is // supposed to watch the returned ConnectionState channel for Connected/Disconnected events. // In case of disconnect, the library will asynchronously try to reconnect. -func AsyncConnect(shm string) (*core.Connection, chan core.ConnectionEvent, error) { - return core.AsyncConnect(getVppAdapter(shm)) +func AsyncConnect(shm string, attempts int, interval time.Duration) (*core.Connection, chan core.ConnectionEvent, error) { + return core.AsyncConnect(getVppAdapter(shm), attempts, interval) } -- 2.16.6