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
dms3
go-dms3
Commits
387c0508
Commit
387c0508
authored
10 years ago
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/net/conn/dialer: added Dialer field
parent
fd3e0bb3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
p2p/net/conn/dial.go
p2p/net/conn/dial.go
+2
-3
p2p/net/conn/interface.go
p2p/net/conn/interface.go
+4
-0
No files found.
p2p/net/conn/dial.go
View file @
387c0508
...
...
@@ -41,11 +41,10 @@ func (d *Dialer) Dial(ctx context.Context, raddr ma.Multiaddr, remote peer.ID) (
}
// TODO: try to get reusing addr/ports to work.
// madialer := manet.Dialer{LocalAddr: laddr}
madialer
:=
manet
.
Dialer
{}
// d.Dialer.LocalAddr = laddr
log
.
Debugf
(
"%s dialing %s %s"
,
d
.
LocalPeer
,
remote
,
raddr
)
maconn
,
err
:=
mad
ialer
.
Dial
(
raddr
)
maconn
,
err
:=
d
.
D
ialer
.
Dial
(
raddr
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
This diff is collapsed.
Click to expand it.
p2p/net/conn/interface.go
View file @
387c0508
...
...
@@ -11,6 +11,7 @@ import (
msgio
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-msgio"
ma
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
manet
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
)
// Map maps Keys (Peer.IDs) to Connections.
...
...
@@ -52,6 +53,9 @@ type Conn interface {
// no longer simple (need a peerstore, a local peer, a context, a network, etc)
type
Dialer
struct
{
// Dialer is an optional manet.Dialer to use.
Dialer
manet
.
Dialer
// LocalPeer is the identity of the local Peer.
LocalPeer
peer
.
ID
...
...
This diff is collapsed.
Click to expand it.
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