Documentation
¶
Index ¶
- func GetAddrInfo(peerId string) string
- func GetPeerId(peerId string) string
- func HandleRaw(data []byte, p *pipe.Pipe) ([]byte, error)
- func ProtocolStream(protocolID protocol.ID)
- type PipePool
- func (this *PipePool) Close(peerId string, protocolId string, connectSessionId string, streamId string)
- func (this *PipePool) CreatePipe(stream network.Stream, direct string) *pipe.Pipe
- func (this *PipePool) Disconnect(peerId string, connectSessionId string)
- func (this *PipePool) GetRequestPipe(peerId string, protocolId string) *pipe.Pipe
- func (this *PipePool) GetResponsePipe(peerId string, connectSessionId string) *pipe.Pipe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAddrInfo ¶
* 如果输入peerId没有地址信息,通过路由表获取完整的地址信息 如果不在路由表中则原样返回,这地方有个问题,定位器有地址信息,客户端没有地址信息
func HandleRaw ¶
* libp2p的流处理模块把接收的数据分发到这里,通用的消息处理分发器根据stream的protocolID作下一步处理分发 比如,chain协议的将进一步分发到p2p的chain协议处理handler
func ProtocolStream ¶
* 根据配置的协议编号自定义流协议,其他peer连接自己的时候,用于在节点间接收和发送数据
Types ¶
type PipePool ¶
type PipePool struct {
// contains filtered or unexported fields
}
func GetPipePool ¶
func GetPipePool() *PipePool
func (*PipePool) CreatePipe ¶
func (*PipePool) Disconnect ¶
func (*PipePool) GetRequestPipe ¶
* 主动发送消息获取管道,如果流不存在,创建一个
Click to show internal directories.
Click to hide internal directories.