sender

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectSend

func DirectSend(msg *msg1.ChainMessage) (*msg1.ChainMessage, error)

DirectSend 定位器之间直接发送方法

func ForwardPeerClient added in v0.1.24

func ForwardPeerClient(chainMessage *msg1.ChainMessage, peerClient *entity.PeerClient) (*msg1.ChainMessage, error)

func ForwardPeerEndpoint added in v0.1.24

func ForwardPeerEndpoint(msg *msg1.ChainMessage, connectPeerId string) (*msg1.ChainMessage, error)

func Lookup added in v0.1.24

func Lookup(targetPeerId string, targetClientId string) (*entity.PeerClient, string, error)

* 本地和分布式查询PeerClient,如果找不到则查找PeerEndpoint 第一个参数返回找到的PeerClient,第二个参数返回找到的PeerEndpoint的peerId,即targetPeerId

func RelaySend

func RelaySend(chainMessage *msg1.ChainMessage) (*msg1.ChainMessage, error)

RelaySend 转发chainmessage,根据TargetPeerId查询TargetConnectSessionId,找到如何到达目标

func Send

func Send(msg *msg1.ChainMessage) (*msg1.ChainMessage, error)

Send 发送ChainMessage消息的唯一方法 1.找出发送的目标地址和方式 2.根据情况处理校验,加密,压缩等 3.建立合适的通道并发送,比如libp2p的Pipe并Write消息流 4.等待即时的返回,校验,解密,解压缩等

Types

This section is empty.

Jump to

Keyboard shortcuts

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