From e5f52695a3b83f8ab38ffe949b2f7a04726dc0ab Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 21 Jan 2021 17:54:03 +0100 Subject: implement pluggable transport Signed-off-by: Mikael Magnusson --- pkg/server/bmp.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pkg/server/bmp.go') diff --git a/pkg/server/bmp.go b/pkg/server/bmp.go index 67eebd0c..828bdd56 100644 --- a/pkg/server/bmp.go +++ b/pkg/server/bmp.go @@ -81,11 +81,11 @@ func (r ribout) update(p *table.Path) bool { return true } -func (b *bmpClient) tryConnect() *net.TCPConn { +func (b *bmpClient) tryConnect() net.Conn { interval := 1 for { log.WithFields(log.Fields{"Topic": "bmp"}).Debugf("Connecting BMP server:%s", b.host) - conn, err := net.Dial("tcp", b.host) + conn, err := transport.Dial("tcp", b.host) if err != nil { select { case <-b.dead: @@ -98,7 +98,7 @@ func (b *bmpClient) tryConnect() *net.TCPConn { } } else { log.WithFields(log.Fields{"Topic": "bmp"}).Infof("BMP server is connected:%s", b.host) - return conn.(*net.TCPConn) + return conn } } } -- cgit v1.2.3