wsprd: print out host and port information so that tests (like playground) don't have to specify their own fixed port.
MultiPart: 2/2
Change-Id: I854e2dcc2df1fe540544989a2539613fe7f4aa31
diff --git a/services/wsprd/wspr.go b/services/wsprd/wspr.go
index 7f54cd3..2945ead 100644
--- a/services/wsprd/wspr.go
+++ b/services/wsprd/wspr.go
@@ -2,6 +2,8 @@
import (
"flag"
+ "fmt"
+ "net"
"v.io/core/veyron2"
@@ -24,10 +26,12 @@
proxy := wspr.NewWSPR(ctx, *port, &listenSpec, *identd, nil)
defer proxy.Shutdown()
- proxy.Listen()
+ addr := proxy.Listen()
go func() {
proxy.Serve()
}()
+ nhost, nport, _ := net.SplitHostPort(addr.String())
+ fmt.Printf("Listening on host: %s port: %s\n", nhost, nport)
<-signals.ShutdownOnSignals(ctx)
}