Documentation ¶
Index ¶
- Variables
- func Close(peerId string, protocolId string, connectSessionId string, streamId string)
- func CreatePipe(stream network.Stream, direct string) *pipe.Pipe
- func Disconnect(peerId string, clientId string, connectSessionId string)
- func GetRequestPipe(peerId string, protocolId string) *pipe.Pipe
- func GetResponsePipe(connectSessionId string) *pipe.Pipe
- func HandleRaw(data []byte, p *pipe.Pipe) ([]byte, error)
- func ProtocolStream(protocolID protocol.ID)
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 Disconnect ¶ added in v0.1.24
func GetRequestPipe ¶ added in v0.1.24
GetRequestPipe 主动发送消息获取管道,如果流不存在,创建一个
func GetResponsePipe ¶ added in v0.1.24
func HandleRaw ¶
* libp2p的流处理模块把接收的数据分发到这里,通用的消息处理分发器根据stream的protocolID作下一步处理分发 比如,chain协议的将进一步分发到p2p的chain协议处理handler
func ProtocolStream ¶
* 根据配置的协议编号自定义流协议,其他peer连接自己的时候,用于在节点间接收和发送数据
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.