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
p2p
go-p2p-swarm
Commits
b39cd0af
Commit
b39cd0af
authored
Aug 17, 2016
by
Jeromy
Committed by
Jeromy Johnson
Aug 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swarm: make stream.Protocol() return type protocol.ID
parent
d22de979
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
swarm_stream.go
swarm_stream.go
+4
-3
No files found.
swarm_stream.go
View file @
b39cd0af
...
...
@@ -2,6 +2,7 @@ package swarm
import
(
inet
"github.com/libp2p/go-libp2p/p2p/net"
protocol
"github.com/libp2p/go-libp2p/p2p/protocol"
ps
"github.com/jbenet/go-peerstream"
)
...
...
@@ -10,7 +11,7 @@ import (
// our Conn and Swarm (instead of just the ps.Conn and ps.Swarm)
type
Stream
struct
{
stream
*
ps
.
Stream
protocol
string
protocol
protocol
.
ID
}
// Stream returns the underlying peerstream.Stream
...
...
@@ -44,11 +45,11 @@ func (s *Stream) Close() error {
return
s
.
stream
.
Close
()
}
func
(
s
*
Stream
)
Protocol
()
string
{
func
(
s
*
Stream
)
Protocol
()
protocol
.
ID
{
return
s
.
protocol
}
func
(
s
*
Stream
)
SetProtocol
(
p
string
)
{
func
(
s
*
Stream
)
SetProtocol
(
p
protocol
.
ID
)
{
s
.
protocol
=
p
}
...
...
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