Skip to content

Commit

Permalink
Merge pull request #5 from marten-seemann/remove-serve
Browse files Browse the repository at this point in the history
remove conn.Serve
  • Loading branch information
Stebalien authored Aug 24, 2017
2 parents 17e524c + a920757 commit 4ca0f79
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions p2p/muxer/mplex/multiplex.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package peerstream_multiplex

import (
"errors"
"net"

smux "github.com/libp2p/go-stream-muxer"
mp "github.com/whyrusleeping/go-multiplex" // Conn is a connection to a remote peer.
)

var ErrUseServe = errors.New("not implemented, use Serve")

type conn struct {
*mp.Multiplex
}
Expand All @@ -32,18 +29,6 @@ func (c *conn) AcceptStream() (smux.Stream, error) {
return c.Multiplex.Accept()
}

// Serve starts listening for incoming requests and handles them
// using given StreamHandler
func (c *conn) Serve(handler smux.StreamHandler) {
for {
s, err := c.AcceptStream()
if err != nil {
return
}
go handler(s)
}
}

// Transport is a go-peerstream transport that constructs
// multiplex-backed connections.
type Transport struct{}
Expand Down

0 comments on commit 4ca0f79

Please sign in to comment.