X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=proxy%2Fproxy.go;h=49c650d7eef376d12e7667ffa3eeb71d122357eb;hb=refs%2Fchanges%2F49%2F26449%2F1;hp=33cf05f87049e56a8e870f98031c5f1464a0c7c8;hpb=58601b470bbd4e5ef534fed83511aa5a7f1c2d1e;p=govpp.git diff --git a/proxy/proxy.go b/proxy/proxy.go index 33cf05f..49c650d 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -51,19 +51,19 @@ func NewServer() (*Server, error) { } func (p *Server) ConnectStats(stats adapter.StatsAPI) error { - return p.statsRPC.Connect(stats) + return p.statsRPC.connect(stats) } func (p *Server) DisconnectStats() { - p.statsRPC.Disconnect() + p.statsRPC.disconnect() } func (p *Server) ConnectBinapi(binapi adapter.VppAPI) error { - return p.binapiRPC.Connect(binapi) + return p.binapiRPC.connect(binapi) } func (p *Server) DisconnectBinapi() { - p.binapiRPC.Disconnect() + p.binapiRPC.disconnect() } func (p *Server) ServeHTTP(w http.ResponseWriter, req *http.Request) { @@ -83,10 +83,11 @@ func (p *Server) ListenAndServe(addr string) error { l, e := net.Listen("tcp", addr) if e != nil { - return fmt.Errorf("listen error:", e) + return fmt.Errorf("listen failed: %v", e) } defer l.Close() log.Printf("proxy serving on: %v", addr) + return http.Serve(l, nil) }