diagnostics: listen on both TCP/IP and vsock ports

The TCP/IP port will be used by Windows, while Mac can use the vsock
one.

Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
David Scott 2016-04-15 17:07:52 +01:00
parent 15b772d496
commit 184fa38903

View File

@ -10,6 +10,7 @@ import (
"path"
"strings"
"time"
"github.com/djs55/vsock"
)
func run(timeout time.Duration, w *tar.Writer, command string, args ...string) {
@ -108,6 +109,12 @@ func main() {
} else {
listeners = append(listeners, ip)
}
vsock, err := vsock.Listen(uint(62374))
if err != nil {
log.Printf("Failed to bind to vsock port 62374: %#v", err)
} else {
listeners = append(listeners, vsock)
}
for _, l := range listeners {
go func(l net.Listener) {