add hidden manual control of SetNoDelay parameters

This commit is contained in:
xtaci
2016-06-03 09:44:02 +08:00
parent c40cf88112
commit 3243a14113
2 changed files with 42 additions and 2 deletions
+21 -1
View File
@@ -105,6 +105,26 @@ func main() {
Value: 46,
Usage: "set DSCP(6bit)",
},
cli.IntFlag{
Name: "nodelay",
Value: 0,
Hidden: true,
},
cli.IntFlag{
Name: "interval",
Value: 40,
Hidden: true,
},
cli.IntFlag{
Name: "resend",
Value: 0,
Hidden: true,
},
cli.IntFlag{
Name: "nc",
Value: 0,
Hidden: true,
},
}
myApp.Action = func(c *cli.Context) {
log.Println("version:", VERSION)
@@ -119,7 +139,7 @@ func main() {
// kcp server
kcpconn, err := kcp.DialWithOptions(c.Int("fec"), c.String("remoteaddr"), []byte(c.String("key")))
checkError(err)
nodelay, interval, resend, nc := 0, 40, 0, 0
nodelay, interval, resend, nc := c.Int("nodelay"), c.Int("interval"), c.Int("resend"), c.Int("nc")
switch c.String("mode") {
case "normal":
+21 -1
View File
@@ -133,10 +133,30 @@ func main() {
Value: 0,
Usage: "set DSCP(6bit)",
},
cli.IntFlag{
Name: "nodelay",
Value: 0,
Hidden: true,
},
cli.IntFlag{
Name: "interval",
Value: 40,
Hidden: true,
},
cli.IntFlag{
Name: "resend",
Value: 0,
Hidden: true,
},
cli.IntFlag{
Name: "nc",
Value: 0,
Hidden: true,
},
}
myApp.Action = func(c *cli.Context) {
log.Println("version:", VERSION)
nodelay, interval, resend, nc := 0, 40, 0, 0
nodelay, interval, resend, nc := c.Int("nodelay"), c.Int("interval"), c.Int("resend"), c.Int("nc")
switch c.String("mode") {
case "normal":
nodelay, interval, resend, nc = 0, 30, 2, 1