Documentation
¶
Index ¶
- type DHTClient
- func (dht *DHTClient) Close() error
- func (dht *DHTClient) Connect(ipList []net.IP, proxyList []*proxyServer) error
- func (dht *DHTClient) Init(hash string) error
- func (dht *DHTClient) RegisterProxy(ip net.IP, port int) error
- func (dht *DHTClient) ReportLoad(clientsNum int) error
- func (dht *DHTClient) WaitID() error
- type Forwarder
- type OperatingMode
- type P2PServerV2
- type PeerIP
- type Peerstate
- type RemotePeerState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DHTClient ¶
type DHTClient struct { Routers string // Comma-separated list of bootstrap nodes NetworkHash string // Saved network hash ID string // Current instance ID FailedRouters []string // List of routes that we failed to connect to LocalPort int // UDP port number used by this instance RemotePort int // UDP port number reported by echo server Forwarders []Forwarder // List of worwarders TCPCallbacks map[protocol.DHTPacketType]dhtCallback // Callbacks for incoming packets Mode OperatingMode // DHT Client mode ??? IPList []net.IP // List of network active interfaces IP net.IP // IP of local interface received from DHCP or specified manually Network *net.IPNet // Network information about current network. Used to inform p2p about mask for interface Connected bool // Whether connection with bootstrap nodes established or not LastUpdate time.Time // When last `find` packet was sent OutboundIP net.IP // Outbound IP ListenerIsRunning bool // True if listener is runnning }
DHT 客户端结构
func (*DHTClient) Close ¶
Close will close all connections and switch DHT object to shutdown mode, which will terminate every loop/goroutine
func (*DHTClient) RegisterProxy ¶
RegisterProxy will register current node as a proxy on bootstrap node
func (*DHTClient) ReportLoad ¶
ReportLoad will send amount of tunnels created on particular proxy
type OperatingMode ¶
type OperatingMode int
Mode DHT client is operating
const ( DHTModeClient OperatingMode = 1 DHTModeProxy OperatingMode = 2 )
可能的操作模式
type P2PServerV2 ¶
type P2PServerV2 struct { }
Click to show internal directories.
Click to hide internal directories.