change sdk to block function call, close #480, close #745

This commit is contained in:
ffdfgdfg 2021-04-08 02:40:32 +08:00
parent 96188ee6ed
commit 36d858d1c7
2 changed files with 3 additions and 5 deletions

View File

@ -12,15 +12,12 @@ var cl *client.TRPClient
//export StartClientByVerifyKey
func StartClientByVerifyKey(serverAddr, verifyKey, connType, proxyUrl *C.char) int {
logs.SetLogger("store")
_ = logs.SetLogger("store")
if cl != nil {
cl.Close()
}
cl = client.NewRPClient(C.GoString(serverAddr), C.GoString(verifyKey), C.GoString(connType), C.GoString(proxyUrl), nil, 60)
go func() {
cl.Start()
return
}()
cl.Start()
return 1
}

View File

@ -2,6 +2,7 @@
```
命令行模式启动客户端
从v0.26.10开始,此函数会阻塞,直到客户端退出返回,请自行管理是否重连
p0->连接地址
p1->vkey
p2->连接类型tcp or udp