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
0b90707e
Commit
0b90707e
authored
Aug 22, 2016
by
Jeromy
Browse files
update transport dep and add host test
parent
82dba851
Changes
2
Hide whitespace changes
Inline
Side-by-side
p2p/host/basic/basic_host_test.go
View file @
0b90707e
...
...
@@ -214,3 +214,31 @@ func TestHostProtoPreknowledge(t *testing.T) {
s
.
Close
()
}
func
TestNewDialOld
(
t
*
testing
.
T
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
defer
cancel
()
h1
,
h2
:=
getHostPair
(
ctx
,
t
)
defer
h1
.
Close
()
defer
h2
.
Close
()
connectedOn
:=
make
(
chan
protocol
.
ID
,
16
)
h1
.
SetStreamHandler
(
"/testing"
,
func
(
s
inet
.
Stream
)
{
connectedOn
<-
s
.
Protocol
()
s
.
Close
()
})
s
,
err
:=
h2
.
NewStream
(
ctx
,
h1
.
ID
(),
"/testing/1.0.0"
,
"/testing"
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
}
assertWait
(
t
,
connectedOn
,
"/testing"
)
if
s
.
Protocol
()
!=
"/testing"
{
t
.
Fatal
(
"shoould have gotten /testing"
)
}
s
.
Close
()
}
package.json
View file @
0b90707e
...
...
@@ -159,9 +159,9 @@
},
{
"author"
:
"whyrusleeping"
,
"hash"
:
"Qm
ep1A25MDNZxMno8oHZ5ForA5T2gw1EXAGdZzGCCpDD4n
"
,
"hash"
:
"Qm
bRuJ16EfPGWuEguoNxwPacpeHFUAZb2XQXVvUt5Vxg5q
"
,
"name"
:
"go-libp2p-transport"
,
"version"
:
"1.3.
4
"
"version"
:
"1.3.
5
"
},
{
"author"
:
"whyrusleeping"
,
...
...
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