"net"
)
+type Peer struct {
+ IP net.IP
+ Port int
+ ID []byte
+}
+
+// Set from the non-compact form in BEP 3.
func (p *Peer) fromDictInterface(d map[string]interface{}) {
p.IP = net.ParseIP(d["ip"].(string))
p.ID = []byte(d["peer id"].(string))
import (
"errors"
- "net"
"net/http"
"net/url"
)
return []string{"empty", "completed", "started", "stopped"}[e]
}
-type Peer struct {
- IP net.IP
- Port int
- ID []byte
-}
-
const (
None AnnounceEvent = iota
Completed // The local peer just completed the torrent.