Skip to content

Commit

Permalink
feat: use go-libp2p-core 0.7.0 stream interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Nov 2, 2020
1 parent a876632 commit 0355efd
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 9 deletions.
8 changes: 1 addition & 7 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"net"
"time"

"github.com/libp2p/go-libp2p-core/helpers"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
Expand Down Expand Up @@ -36,12 +35,7 @@ func (c *conn) Write(b []byte) (n int, err error) {
// Close closes the connection.
// Any blocked Read or Write operations will be unblocked and return errors.
func (c *conn) Close() error {
if err := c.s.Close(); err != nil {
c.s.Reset()
return err
}
go helpers.AwaitEOF(c.s)
return nil
return c.s.Close()
}

// LocalAddr returns the local network address.
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/libp2p/go-libp2p-gostream
go 1.14

require (
github.com/libp2p/go-libp2p v0.11.0
github.com/libp2p/go-libp2p-core v0.6.1
github.com/libp2p/go-libp2p v0.11.1-0.20201102192925-b33cbc714465
github.com/libp2p/go-libp2p-core v0.7.0
github.com/multiformats/go-multiaddr v0.3.1
)
Loading

0 comments on commit 0355efd

Please sign in to comment.