some net docs
Jeromy committed
Nov 8, 2014 at 20:44 UTC
b0f4b7c89dba78094259039f99df93a7f817b2ae
2 files changed
+5
-6
net/conn/interface.go
+3
-4
@@ -22,7 +22,7 @@ type Conn interface {
22
// LocalMultiaddr is the Multiaddr on this side
23
LocalMultiaddr() ma.Multiaddr
24
25
- // LocalPeer is the Peer on this side
25
+ // LocalPeer is the Peer on our side of the connection
26
LocalPeer() peer.Peer
27
28
// RemoteMultiaddr is the Multiaddr on the remote side
@@ -37,10 +37,9 @@ type Conn interface {
37
// Out returns a writable message channel
38
Out() chan<- []byte
39
40
+ // Get an error from this conn if one is available
41
+ // TODO: implement a better error handling system
42
GetError() error
41
-
42
- // Close ends the connection
43
- // Close() error -- already in ContextCloser
43
}
44
45
// Dialer is an object that can open connections. We could have a "convenience"
net/interface.go
+2
-2
@@ -59,9 +59,9 @@ type Handler srv.Handler
59
// Service interface for network resources.
60
type Service srv.Service
61
62
-// Dialer service that can dial to peers
62
+// Dialer represents a service that can dial out to peers
63
// (this is usually just a Network, but other services may not need the whole
64
-// thing, and thus it becomes easier to mock)
64
+// stack, and thus it becomes easier to mock)
65
type Dialer interface {
66
67
// DialPeer attempts to establish a connection to a given peer