Add flag specifying TCP listen address

This commit is contained in:
Trevor Slocum 2023-09-07 20:06:15 -07:00
parent e075b38b54
commit fe68234adb

View file

@ -1,5 +1,7 @@
package main
import "flag"
func main() {
/*
b := bgammon.NewBoard()
@ -28,8 +30,11 @@ func main() {
}()
select {}
*/
var address string
flag.StringVar(&address, "tcp", "localhost:1337", "TCP listen address")
flag.Parse()
s := newServer()
s.listen("tcp", "127.0.0.1:1337")
s.listen("tcp", address)
select {}
}