Skip to content

Commit

Permalink
Revert changes to gostream. Not the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoPolo committed May 16, 2024
1 parent ff641a8 commit 77e22e2
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions p2p/net/gostream/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ package gostream
import (
"context"
"net"
"time"

"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/protocol"
)

var ServerTimeout = 60 * time.Second

// listener is an implementation of net.Listener which handles
// http-tagged streams from a libp2p connection.
// A listener can be built with Listen()
Expand Down Expand Up @@ -63,7 +60,6 @@ func Listen(h host.Host, tag protocol.ID) (net.Listener, error) {
}

h.SetStreamHandler(tag, func(s network.Stream) {
s.SetDeadline(time.Now().Add(ServerTimeout))
select {
case l.streamCh <- s:
case <-ctx.Done():
Expand Down

0 comments on commit 77e22e2

Please sign in to comment.