Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-tcp-transport
Commits
426c89fd
Commit
426c89fd
authored
Apr 09, 2017
by
Marten Seemann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace tpt.ConnWrap by a tcpConn
The tpt.ConnWrap is being removed from go-libp2p-transport
parent
5a21aa94
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
tcp.go
tcp.go
+16
-4
No files found.
tcp.go
View file @
426c89fd
...
@@ -199,9 +199,9 @@ func (d *tcpDialer) DialContext(ctx context.Context, raddr ma.Multiaddr) (tpt.Co
...
@@ -199,9 +199,9 @@ func (d *tcpDialer) DialContext(ctx context.Context, raddr ma.Multiaddr) (tpt.Co
return
nil
,
err
return
nil
,
err
}
}
return
&
tp
t
.
Conn
Wrap
{
return
&
t
c
pConn
{
Conn
:
c
,
Conn
:
c
,
Tp
t
:
d
.
transport
,
t
:
d
.
transport
,
},
nil
},
nil
}
}
...
@@ -250,9 +250,9 @@ func (d *tcpListener) Accept() (tpt.Conn, error) {
...
@@ -250,9 +250,9 @@ func (d *tcpListener) Accept() (tpt.Conn, error) {
return
nil
,
err
return
nil
,
err
}
}
return
&
tp
t
.
Conn
Wrap
{
return
&
t
c
pConn
{
Conn
:
c
,
Conn
:
c
,
Tp
t
:
d
.
transport
,
t
:
d
.
transport
,
},
nil
},
nil
}
}
...
@@ -271,3 +271,15 @@ func (t *tcpListener) NetListener() net.Listener {
...
@@ -271,3 +271,15 @@ func (t *tcpListener) NetListener() net.Listener {
func
(
d
*
tcpListener
)
Close
()
error
{
func
(
d
*
tcpListener
)
Close
()
error
{
return
d
.
list
.
Close
()
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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment