Add flag specifying TCP listen address
This commit is contained in:
parent
e075b38b54
commit
fe68234adb
1 changed files with 6 additions and 1 deletions
|
@ -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 {}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue