multicast

package
v0.0.0-...-58a2b35 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MSGID_P2P_SEND_MULTICAST_MSG      = 20010 // 发送组播消息
	MSGID_P2P_SEND_MULTICAST_MSG_RECV = 20011 // 发送组播消息的返回
)

消息号

Variables

View Source
var (
	Err_MULTICAST_MSG_NOT_INIT       = errors.New("multicast is not init")
	Err_MULTICAST_NODES_EMPTY        = errors.New("nodeIds is empty")
	Err_MULTICAST_MSGID_INVALID      = errors.New("msgid is invalid")
	Err_MULTICAST_COUNTRY_NODE_EMPTY = errors.New("country node is empty")
)

错误信息

Functions

This section is empty.

Types

type MulticastMsg

type MulticastMsg struct {
	Area    *libp2parea.Area     // 节点信息
	Country *country.AreaCountry // 大区信息
	// contains filtered or unexported fields
}

组播消息

func NewMulticastMsg

func NewMulticastMsg(area *libp2parea.Area, country *country.AreaCountry) (gm *MulticastMsg)

* 创建组播消息 * * @param area *Area 所属区域 * @param country *AreaCountry 大区信息 * @return mm *MulticastMsg 群消息

func (*MulticastMsg) SendMulticastMsg

func (gm *MulticastMsg) SendMulticastMsg(msgId uint64, nodeIds []*NodeMachineInfo, content string, timeout time.Duration) error

* 发送组播消息 * * @param msgId uint64 消息号 * @param nodeIds []*AddressNet 接收端的地址列表 * @param content string 消息内容

type NodeMachineInfo

type NodeMachineInfo struct {
	NodeId    nodeStore.AddressNet // 节点地址
	MachineID string               // 机器id
}

节点机器id结构信息

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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