p2p/host: doc options
Juan Batiz-Benet committed
Jan 26, 2015 at 15:02 UTC
2c13280b5efd8d9e60129731c4649fd42c08532a
1 file changed
+12
p2p/host/basic/basic_host.go
+12
@@ -19,12 +19,24 @@ import (
19
20
var log = eventlog.Logger("p2p/host/basic")
21
22
+// Option is a type used to pass in options to the host.
23
type Option int
24
25
const (
26
+ // NATPortMap makes the host attempt to open port-mapping in NAT devices
27
+ // for all its listeners. Pass in this option in the constructor to
28
+ // asynchronously a) find a gateway, b) open port mappings, c) republish
29
+ // port mappings periodically. The NATed addresses are included in the
30
+ // Host's Addrs() list.
31
NATPortMap Option = iota
32
)
33
34
+// BasicHost is the basic implementation of the host.Host interface. This
35
+// particular host implementation:
36
+// * uses a protocol muxer to mux per-protocol streams
37
+// * uses an identity service to send + receive node information
38
+// * uses a relay service to allow hosts to relay conns for each other
39
+// * uses a nat service to establish NAT port mappings
40
type BasicHost struct {
41
network inet.Network
42
mux *protocol.Mux