Documentation ¶
Index ¶
- type Listener
- type Listeners
- type P2P
- func (p2p *P2P) CheckProtoExists(proto string) bool
- func (p2p *P2P) ForwardLocal(ctx context.Context, peer peer.ID, proto protocol.ID, bindAddr ma.Multiaddr) (Listener, error)
- func (p2p *P2P) ForwardRemote(ctx context.Context, proto protocol.ID, addr ma.Multiaddr, reportRemote bool) (Listener, error)
- type Stream
- type StreamRegistry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener interface { Protocol() protocol.ID ListenAddress() ma.Multiaddr TargetAddress() ma.Multiaddr // contains filtered or unexported methods }
侦听器侦听连接并将其代理到目标
type P2P ¶
type P2P struct { ListenersLocal *Listeners ListenersP2P *Listeners Streams *StreamRegistry // contains filtered or unexported fields }
p2p结构保存当前运行的流/侦听器的信息
func (*P2P) CheckProtoExists ¶
checkprotoexists检查是否向注册了proto处理程序 多路复用器
type Stream ¶
type Stream struct { Protocol protocol.ID OriginAddr ma.Multiaddr TargetAddr ma.Multiaddr Local manet.Conn Remote net.Stream Registry *StreamRegistry // contains filtered or unexported fields }
流保存有关活动的传入和传出P2P流的信息。
type StreamRegistry ¶
type StreamRegistry struct { sync.Mutex Streams map[uint64]*Stream ifconnmgr.ConnManager // contains filtered or unexported fields }
streamregistry是活动的传入和传出协议应用程序流的集合。
Click to show internal directories.
Click to hide internal directories.