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 authored and gts2030 committed May 23, 2024
1 parent 377c557 commit 1d06565
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions p2p/net/gostream/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

0 comments on commit 1d06565

Please sign in to comment.