add
This commit is contained in:
1 parent
d72a7ff774
commit
b76965fe52
5 files changed
+52
-5
No files matched your search
+4
-1
@@ -36,6 +36,8 @@ Usage:
|
||||
|
||||
-rproto 客户端接收ping协议的协议,默认是0
|
||||
The protocol that the client receives the ping. The default is 0.
|
||||
|
||||
-hb 客户端保持每秒发到服务器的心跳包,用于在某些网络下更新服务器的id和seq,以接收到服务器的reply
|
||||
`
|
||||
|
||||
func main() {
|
||||
@@ -47,6 +49,7 @@ func main() {
|
||||
timeout := flag.Int("timeout", 60, "conn timeout")
|
||||
sproto := flag.Int("sproto", 8, "send ping proto")
|
||||
rproto := flag.Int("rproto", 0, "recv ping proto")
|
||||
hb := flag.Int("hb", 0, "client heartbeat")
|
||||
flag.Usage = func() {
|
||||
fmt.Printf(usage)
|
||||
}
|
||||
@@ -76,7 +79,7 @@ func main() {
|
||||
fmt.Printf("server %s\n", *server)
|
||||
fmt.Printf("target %s\n", *target)
|
||||
|
||||
c, err := pingtunnel.NewClient(*listen, *server, *target, *timeout, *sproto, *rproto)
|
||||
c, err := pingtunnel.NewClient(*listen, *server, *target, *timeout, *sproto, *rproto, *hb)
|
||||
if err != nil {
|
||||
fmt.Printf("ERROR: %s\n", err.Error())
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user