From e144e112ca8f42f7e1dbc6dd8138d7438c869774 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 26 May 2022 11:10:35 +0200 Subject: [PATCH] re-add NewTCPTransport method (#121) * re-add NewTCPTransport method * release v0.6.1 --- go.mod | 6 ++++-- tcp.go | 10 ++++++++++ version.json | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 43591b3..7478619 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,10 @@ module github.com/libp2p/go-tcp-transport go 1.17 -require github.com/libp2p/go-libp2p v0.20.0 +require ( + github.com/libp2p/go-libp2p v0.20.0 + github.com/libp2p/go-libp2p-core v0.16.1 +) require ( github.com/beorn7/perks v1.0.1 // indirect @@ -18,7 +21,6 @@ require ( github.com/ipfs/go-log/v2 v2.5.1 // indirect github.com/klauspost/cpuid/v2 v2.0.9 // indirect github.com/libp2p/go-buffer-pool v0.0.2 // indirect - github.com/libp2p/go-libp2p-core v0.16.1 // indirect github.com/libp2p/go-netroute v0.2.0 // indirect github.com/libp2p/go-openssl v0.0.7 // indirect github.com/libp2p/go-reuseport v0.2.0 // indirect diff --git a/tcp.go b/tcp.go index 23489c9..b9f9c0e 100644 --- a/tcp.go +++ b/tcp.go @@ -4,6 +4,9 @@ package tcp import ( "time" + "github.com/libp2p/go-libp2p-core/network" + "github.com/libp2p/go-libp2p-core/transport" + "github.com/libp2p/go-libp2p/p2p/transport/tcp" ) @@ -23,3 +26,10 @@ func WithConnectionTimeout(d time.Duration) Option { // TcpTransport is the TCP transport. // Deprecated: use github.com/libp2p/go-libp2p/p2p/transport/tcp.TcpTransport instead. type TcpTransport = tcp.TcpTransport + +// NewTCPTransport creates a tcp transport object that tracks dialers and listeners +// created. It represents an entire TCP stack (though it might not necessarily be). +// Deprecated: use github.com/libp2p/go-libp2p/p2p/transport/tcp.NewTCPTransport instead. +func NewTCPTransport(upgrader transport.Upgrader, rcmgr network.ResourceManager, opts ...Option) (*TcpTransport, error) { + return tcp.NewTCPTransport(upgrader, rcmgr, opts...) +} diff --git a/version.json b/version.json index 42c14d1..eb3a29f 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "v0.6.0" + "version": "v0.6.1" }