Skip to content

Commit

Permalink
Merge pull request #2 from heri16/patch-1
Browse files Browse the repository at this point in the history
Add bind flag
  • Loading branch information
pforemski authored Sep 19, 2016
2 parents 15c97cf + 24d7365 commit 6a50ebb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dingo.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import "github.com/patrickmn/go-cache"

/* command-line arguments */
var (
bindip = flag.String("bind", "0.0.0.0", "bind to interface ip")
port = flag.Int("port", 32000, "listen on port number")
dbglvl = flag.Int("dbg", 1, "debugging level")
workers = flag.Int("workers", 10, "number of independent workers")
Expand Down Expand Up @@ -209,7 +210,7 @@ func main() {
rcache = cache.New(24*time.Hour, 60*time.Second)

/* listen */
laddr := net.UDPAddr{ Port: *port }
laddr := net.UDPAddr{ IP: net.ParseIP(*bindip), Port: *port }
uc, err := net.ListenUDP("udp", &laddr)
if err != nil { die(err) }

Expand Down

0 comments on commit 6a50ebb

Please sign in to comment.