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
Show 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) (
...
@@ -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.
// TODO: try to get reusing addr/ports to work.
// madialer := manet.Dialer{LocalAddr: laddr}
// d.Dialer.LocalAddr = laddr
madialer
:=
manet
.
Dialer
{}
log
.
Debugf
(
"%s dialing %s %s"
,
d
.
LocalPeer
,
remote
,
raddr
)
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
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
net/conn/interface.go
View file @
0e4276e4
...
@@ -11,6 +11,7 @@ import (
...
@@ -11,6 +11,7 @@ import (
msgio
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-msgio"
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"
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.
// Map maps Keys (Peer.IDs) to Connections.
...
@@ -52,6 +53,9 @@ type Conn interface {
...
@@ -52,6 +53,9 @@ type Conn interface {
// no longer simple (need a peerstore, a local peer, a context, a network, etc)
// no longer simple (need a peerstore, a local peer, a context, a network, etc)
type
Dialer
struct
{
type
Dialer
struct
{
// Dialer is an optional manet.Dialer to use.
Dialer
manet
.
Dialer
// LocalPeer is the identity of the local Peer.
// LocalPeer is the identity of the local Peer.
LocalPeer
peer
.
ID
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