Browse Source

change OpenStream to accept a context

pull/1450/head
Marten Seemann 4 years ago
parent
commit
c2feedff5c
  1. 4
      p2p/muxer/mplex/conn.go

4
p2p/muxer/mplex/conn.go

@ -1,6 +1,8 @@
package peerstream_multiplex package peerstream_multiplex
import ( import (
"context"
"github.com/libp2p/go-libp2p-core/mux" "github.com/libp2p/go-libp2p-core/mux"
mp "github.com/libp2p/go-mplex" mp "github.com/libp2p/go-mplex"
) )
@ -16,7 +18,7 @@ func (c *conn) IsClosed() bool {
} }
// OpenStream creates a new stream. // OpenStream creates a new stream.
func (c *conn) OpenStream() (mux.MuxedStream, error) { func (c *conn) OpenStream(context.Context) (mux.MuxedStream, error) {
s, err := c.mplex().NewStream() s, err := c.mplex().NewStream()
if err != nil { if err != nil {
return nil, err return nil, err

Loading…
Cancel
Save