Skip to content

Commit

Permalink
change sdk to block function call, close ehang-io#480, close ehang-io…
Browse files Browse the repository at this point in the history
  • Loading branch information
ffdfgdfg committed Apr 7, 2021
1 parent 96188ee commit 36d858d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cmd/npc/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions docs/npc_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

0 comments on commit 36d858d

Please sign in to comment.