mux

package
v0.0.0-...-5348f4d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn wraps mux session

func NewConn

func NewConn(dialFn func() (io.ReadWriteCloser, error)) *Conn

NewConn method

func (*Conn) NumStreams

func (conn *Conn) NumStreams() int

func (*Conn) OpenStream

func (conn *Conn) OpenStream() (*smux.Stream, error)

OpenStream warps session's openStream with retry

type Pool

type Pool struct {
	MaxIdle int
	MaxMux  int
	// contains filtered or unexported fields
}

Pool implement mux conn pool

func NewPool

func NewPool(maxIdle, maxMux int, dialFn func() (io.ReadWriteCloser, error)) *Pool

NewPool method

func (*Pool) GetStream

func (p *Pool) GetStream() (*smux.Stream, error)

GetStream fetch a stream from conn pool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL