Documentation
¶
Index ¶
- func Dispatch(chainMessage *msg1.ChainMessage) (*msg1.ChainMessage, error)
- func HandleDisconnected(connectSessionId string)
- func PutPeeClientId(connectSessionId string, remotePeerId string, clientId string)
- func ReceiveRaw(data []byte, remotePeerId string, clientId string, connectSessionId string, ...) ([]byte, error)
- type PeeClientId
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 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
PeeClientId sessionId与PeeClientd的对应关系,删除连接时有用
Click to show internal directories.
Click to hide internal directories.