status-go/vendor/github.com/anacrolix/go-libutp/status.go

18 lines
315 B
Go
Raw Normal View History

2022-03-10 09:44:48 +00:00
package utp
import (
"fmt"
"io"
)
func WriteStatus(w io.Writer) {
mu.Lock()
defer mu.Unlock()
for _, s := range libContextToSocket {
fmt.Fprintf(w, "listening at %s\n", s.Addr())
fmt.Fprintf(w, "has %d conns\n", len(s.conns))
fmt.Fprintf(w, "backlog: %d\n", len(s.backlog))
fmt.Fprintf(w, "\n")
}
}