Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrStreamNotFound = errors.New("stream not found")
)
Functions ¶
func NewStreamManager ¶
func NewStreamManager(node quaiprotocol.QuaiP2PNode, host host.Host) (*basicStreamManager, error)
Types ¶
type StreamManager ¶
type StreamManager interface { // Set the host for the stream manager SetP2PBackend(quaiprotocol.QuaiP2PNode) // Get/Set the host for the stream manager GetHost() host.Host SetHost(host.Host) // GetStream returns a valid stream, either creating a new one or returning an existing one GetStream(peer.ID) (network.Stream, error) // CloseStream goes through all the steps to properly close and remove a stream's resources CloseStream(peer.ID) error // WriteMessageToStream writes the given message into the given stream WriteMessageToStream(peerID p2p.PeerID, stream network.Stream, msg []byte, protoversion protocol.ID, reporter libp2pmetrics.Reporter) error }
Click to show internal directories.
Click to hide internal directories.