Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
2c13280b
Commit
2c13280b
authored
Jan 26, 2015
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/host: doc options
parent
158f5061
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
p2p/host/basic/basic_host.go
p2p/host/basic/basic_host.go
+12
-0
No files found.
p2p/host/basic/basic_host.go
View file @
2c13280b
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment