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
mf
go-multiaddr
Commits
2b8f3530
Commit
2b8f3530
authored
Jan 09, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable utp for now (broken)
parent
13314e3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
net.go
net.go
+15
-12
net_test.go
net_test.go
+2
-1
No files found.
net.go
View file @
2b8f3530
...
...
@@ -4,7 +4,7 @@ import (
"fmt"
"net"
utp
"github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/h2so5/utp"
//
utp "github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/h2so5/utp"
ma
"github.com/jbenet/go-multiaddr-net/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
)
...
...
@@ -112,16 +112,18 @@ func (d *Dialer) Dial(remote ma.Multiaddr) (Conn, error) {
return
nil
,
err
}
case
"utp"
:
// construct utp dialer, with options on our net.Dialer
utpd
:=
utp
.
Dialer
{
Timeout
:
d
.
Dialer
.
Timeout
,
LocalAddr
:
d
.
Dialer
.
LocalAddr
,
}
nconn
,
err
=
utpd
.
Dial
(
rnet
,
rnaddr
)
if
err
!=
nil
{
return
nil
,
err
}
return
nil
,
fmt
.
Errorf
(
"utp is currently broken"
)
// // construct utp dialer, with options on our net.Dialer
// utpd := utp.Dialer{
// Timeout: d.Dialer.Timeout,
// LocalAddr: d.Dialer.LocalAddr,
// }
//
// nconn, err = utpd.Dial(rnet, rnaddr)
// if err != nil {
// return nil, err
// }
}
// get local address (pre-specified or assigned within net.Conn)
...
...
@@ -225,7 +227,8 @@ func Listen(laddr ma.Multiaddr) (Listener, error) {
var
nl
net
.
Listener
switch
lnet
{
case
"utp"
:
nl
,
err
=
utp
.
Listen
(
lnet
,
lnaddr
)
// nl, err = utp.Listen(lnet, lnaddr)
return
nil
,
fmt
.
Errorf
(
"utp is currently broken"
)
default
:
nl
,
err
=
net
.
Listen
(
lnet
,
lnaddr
)
}
...
...
net_test.go
View file @
2b8f3530
...
...
@@ -165,7 +165,7 @@ func TestListenAddrs(t *testing.T) {
test
(
"/ip4/127.0.0.1/tcp/4324"
,
true
)
test
(
"/ip4/127.0.0.1/udp/4325"
,
false
)
test
(
"/ip4/127.0.0.1/udp/4326/udt"
,
false
)
test
(
"/ip4/127.0.0.1/udp/4326/utp"
,
true
)
//
test("/ip4/127.0.0.1/udp/4326/utp", true)
}
func
TestListenAndDial
(
t
*
testing
.
T
)
{
...
...
@@ -230,6 +230,7 @@ func TestListenAndDial(t *testing.T) {
}
func
TestListenAndDialUTP
(
t
*
testing
.
T
)
{
t
.
Skip
(
"utp is broken"
)
maddr
:=
newMultiaddr
(
t
,
"/ip4/127.0.0.1/udp/4323/utp"
)
listener
,
err
:=
Listen
(
maddr
)
...
...
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