Commit 44fe2f07 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet
Browse files

p2p/host: doc options

parent d7a5d2ec
...@@ -19,12 +19,24 @@ import ( ...@@ -19,12 +19,24 @@ import (
var log = eventlog.Logger("p2p/host/basic") var log = eventlog.Logger("p2p/host/basic")
// Option is a type used to pass in options to the host.
type Option int type Option int
const ( const (
// NATPortMap makes the host attempt to open port-mapping in NAT devices
// for all its listeners. Pass in this option in the constructor to
// asynchronously a) find a gateway, b) open port mappings, c) republish
// port mappings periodically. The NATed addresses are included in the
// Host's Addrs() list.
NATPortMap Option = iota NATPortMap Option = iota
) )
// BasicHost is the basic implementation of the host.Host interface. This
// particular host implementation:
// * uses a protocol muxer to mux per-protocol streams
// * uses an identity service to send + receive node information
// * uses a relay service to allow hosts to relay conns for each other
// * uses a nat service to establish NAT port mappings
type BasicHost struct { type BasicHost struct {
network inet.Network network inet.Network
mux *protocol.Mux mux *protocol.Mux
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment