net

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReadTimeout = fmt.Errorf("timed out reading response")

ErrReadTimeout is an error that occurs when no message is read within the timeout period.

Functions

func NewMessageSenderImpl

func NewMessageSenderImpl(h host.Host, protos []protocol.ID) pb.MessageSenderWithDisconnect

NewMessageSenderImpl 创建一个 messageSenderImpl 实例。 它接受一个 Host 实例和协议 ID 的列表作为参数,并返回一个实现了 MessageSenderWithDisconnect 接口的实例。

func WriteMsg

func WriteMsg(w io.Writer, mes *pb.Message) error

WriteMsg 方法用于将消息写入到 io.Writer 接口中。

Types

This section is empty.

Jump to

Keyboard shortcuts

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