Rename network flag to proto
parent
9ef76f1064
commit
40c2b50f91
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
network := flag.String("network", "tcp", "network type for server to listen on (tcp, unix)")
|
proto := flag.String("proto", "tcp", "protocol for api to use (tcp, unix)")
|
||||||
address := flag.String("address", "0.0.0.0", "network address for server to listen on")
|
address := flag.String("address", "0.0.0.0", "network address for server to listen on")
|
||||||
|
|
||||||
dbuser := flag.String("dbuser", "pokerogue", "database username")
|
dbuser := flag.String("dbuser", "pokerogue", "database username")
|
||||||
|
@ -28,16 +28,16 @@ func main() {
|
||||||
log.Fatalf("failed to initialize database: %s", err)
|
log.Fatalf("failed to initialize database: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if *network == "unix" {
|
if *proto == "unix" {
|
||||||
os.Remove(*address)
|
os.Remove(*address)
|
||||||
}
|
}
|
||||||
|
|
||||||
listener, err := net.Listen(*network, *address)
|
listener, err := net.Listen(*proto, *address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("failed to create net listener: %s", err)
|
log.Fatalf("failed to create net listener: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if *network == "unix" {
|
if *proto == "unix" {
|
||||||
os.Chmod(*address, 0777)
|
os.Chmod(*address, 0777)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue