YTSFlix_Go/vendor/github.com/anacrolix/go-libutp/status.go
2018-11-04 15:58:15 +01:00

18 lines
315 B
Go

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")
}
}