Improve client status
This commit is contained in:
parent
ef7c4f4120
commit
ec1c4b0cf8
|
@ -96,7 +96,13 @@ type Client struct {
|
||||||
func (cl *Client) WriteStatus(w io.Writer) {
|
func (cl *Client) WriteStatus(w io.Writer) {
|
||||||
cl.mu.Lock()
|
cl.mu.Lock()
|
||||||
defer cl.mu.Unlock()
|
defer cl.mu.Unlock()
|
||||||
fmt.Fprintf(w, "Half open: %d\n", cl.halfOpen)
|
if cl.Listener != nil {
|
||||||
|
fmt.Fprintf(w, "Listening on %s\n", cl.Listener.Addr())
|
||||||
|
} else {
|
||||||
|
fmt.Fprintf(w, "No listening torrent port!\n")
|
||||||
|
}
|
||||||
|
fmt.Fprintf(w, "Peer ID: %q\n", cl.PeerId)
|
||||||
|
fmt.Fprintf(w, "Half open outgoing connections: %d\n", cl.halfOpen)
|
||||||
if cl.DHT != nil {
|
if cl.DHT != nil {
|
||||||
fmt.Fprintf(w, "DHT nodes: %d\n", cl.DHT.NumNodes())
|
fmt.Fprintf(w, "DHT nodes: %d\n", cl.DHT.NumNodes())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue