Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
0e4276e4
Commit
0e4276e4
authored
Jan 11, 2015
by
Juan Batiz-Benet
Browse files
p2p/net/conn/dialer: added Dialer field
parent
2f19d9fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
net/conn/dial.go
View file @
0e4276e4
...
...
@@ -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
}
...
...
net/conn/interface.go
View file @
0e4276e4
...
...
@@ -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
...
...
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