X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=govpp.go;h=f36ce40a57b7de0510bb4304a13b8bbb9f383029;hb=2f75863ba9bff2d2f3488b70e441b5eefc91dfd2;hp=f679242a5a6f78be60e5691d42fbb695688c321f;hpb=c00356ec332203f353fcd5f5992226940d90da92;p=govpp.git diff --git a/govpp.go b/govpp.go index f679242..f36ce40 100644 --- a/govpp.go +++ b/govpp.go @@ -15,8 +15,10 @@ package govpp import ( + "time" + "git.fd.io/govpp.git/adapter" - "git.fd.io/govpp.git/adapter/vppapiclient" + "git.fd.io/govpp.git/adapter/socketclient" "git.fd.io/govpp.git/core" ) @@ -25,9 +27,9 @@ var ( vppAdapter adapter.VppAPI ) -func getVppAdapter(shm string) adapter.VppAPI { +func getVppAdapter(addr string) adapter.VppAPI { if vppAdapter == nil { - vppAdapter = vppapiclient.NewVppClient(shm) + vppAdapter = socketclient.NewVppClient(addr) } return vppAdapter } @@ -49,6 +51,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) }