network

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteMatcher

func ByteMatcher(b byte) cmux.Matcher

func Dial

func Dial(network, address string, header string) (net.Conn, error)

func DialTimeout

func DialTimeout(network, address string, header string, timeout time.Duration) (net.Conn, error)

func ListenByte

func ListenByte(mux cmux.CMux, header byte) net.Listener

func ListenString

func ListenString(mux cmux.CMux, header string) net.Listener

func StringMatcher

func StringMatcher(str string) cmux.Matcher

Types

type Listener

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

Listener 用于处理 Mux 中建立的网络连接的监听器

func (*Listener) Accept

func (ln *Listener) Accept() (net.Conn, error)

Accept 等待并返回下一个连接到该监听器的连接

func (*Listener) Addr

func (ln *Listener) Addr() net.Addr

Addr 返回所属 mux 中被复用的监听器的网络地址

func (*Listener) Close

func (ln *Listener) Close() error

Close 将监听器从所属 mux 中移除并关闭内部通道,任何阻塞的 Accept 操作都将不再阻塞并返回错误。

Jump to

Keyboard shortcuts

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