receiver

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: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dispatch added in v0.1.24

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

Dispatch 接收ChainMessage报文处理的入口,无论何种方式(libp2p,wss,stdhttp)发送过来 的任何ChainMessage类型都统一在此处理分发

func HandleDisconnected added in v0.1.24

func HandleDisconnected(connectSessionId string)

func PutPeeClientId added in v0.1.24

func PutPeeClientId(connectSessionId string, remotePeerId string, clientId string)

func ReceiveRaw added in v0.1.24

func ReceiveRaw(data []byte, remotePeerId string, clientId string, connectSessionId string, remoteAddr string) ([]byte, error)

HandleChainMessage libp2p,wss,https的处理handler,将原始数据还原成ChainMessage, 然后根据消息类型进行分支处理 对于libp2p,可以提前获取远程peerId,remotePeerId不为空,已经建立了remotePeerId和sessId的连接池 用于信息返回 对于wss,remotePeerId为空,必须从ChainMessage中获取,再建立连接池 对于https,remotePeerId为空,必须从ChainMessage中获取,无须连接池,不能异步返回信息

Types

type PeeClientId added in v0.1.24

type PeeClientId struct {
	PeerId   string
	ClientId string
}

PeeClientId sessionId与PeeClientd的对应关系,删除连接时有用

Jump to

Keyboard shortcuts

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