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

18 lines
315 B
Go
Raw Normal View History

2018-11-04 14:58:15 +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")
}
}