handler

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NetworkConnectionPool = make(map[string]network.Conn)

PipePool libp2p的连接池

View Source
var RequestPipePool = make(map[string]*pipe.Pipe)
View Source
var ResponsePipePool = make(map[string]*pipe.Pipe)

Functions

func Close added in v0.1.24

func Close(peerId string, protocolId string, connectSessionId string, streamId string)

func CreatePipe added in v0.1.24

func CreatePipe(stream network.Stream, direct string) *pipe.Pipe

func Disconnect added in v0.1.24

func Disconnect(peerId string, clientId string, connectSessionId string)

func GetRequestPipe added in v0.1.24

func GetRequestPipe(peerId string, protocolId string) *pipe.Pipe

GetRequestPipe 主动发送消息获取管道,如果流不存在,创建一个

func GetResponsePipe added in v0.1.24

func GetResponsePipe(connectSessionId string) *pipe.Pipe

func HandleRaw

func HandleRaw(data []byte, p *pipe.Pipe) ([]byte, error)

* libp2p的流处理模块把接收的数据分发到这里,通用的消息处理分发器根据stream的protocolID作下一步处理分发 比如,chain协议的将进一步分发到p2p的chain协议处理handler

func ProtocolStream

func ProtocolStream(protocolID protocol.ID)

* 根据配置的协议编号自定义流协议,其他peer连接自己的时候,用于在节点间接收和发送数据

Types

This section is empty.

Jump to

Keyboard shortcuts

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