Commit 426c89fd authored by Marten Seemann's avatar Marten Seemann

replace tpt.ConnWrap by a tcpConn

The tpt.ConnWrap is being removed from go-libp2p-transport
parent 5a21aa94
......@@ -199,9 +199,9 @@ func (d *tcpDialer) DialContext(ctx context.Context, raddr ma.Multiaddr) (tpt.Co
return nil, err
}
return &tpt.ConnWrap{
return &tcpConn{
Conn: c,
Tpt: d.transport,
t: d.transport,
}, nil
}
......@@ -250,9 +250,9 @@ func (d *tcpListener) Accept() (tpt.Conn, error) {
return nil, err
}
return &tpt.ConnWrap{
return &tcpConn{
Conn: c,
Tpt: d.transport,
t: d.transport,
}, nil
}
......@@ -271,3 +271,15 @@ func (t *tcpListener) NetListener() net.Listener {
func (d *tcpListener) Close() error {
return d.list.Close()
}
type tcpConn struct {
manet.Conn
t tpt.Transport
}
var _ tpt.Conn = &tcpConn{}
var _ tpt.SingleStreamConn = &tcpConn{}
func (c *tcpConn) Transport() tpt.Transport {
return c.t
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment