net

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReadTimeout = fmt.Errorf("读取响应超时")

ErrReadTimeout 在超时期间内未读取到消息时发生的错误

Functions

func NewMessageSenderImpl

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

NewMessageSenderImpl 创建新的消息发送器实现 参数:

  • h: host.Host 主机
  • protos: []protocol.ID 协议列表

返回值:

  • pb.MessageSenderWithDisconnect 消息发送器接口

func WriteMsg

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

WriteMsg 写入消息 参数:

  • w: io.Writer 写入器
  • mes: *pb.Message 要写入的消息

返回值:

  • error 错误信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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