1
0
mirror of https://github.com/ehang-io/nps synced 2025-10-26 11:48:20 +08:00
nps/cmd/npc/sdk.go
2019-12-03 20:25:22 +08:00

34 lines
522 B
Go

package main
import "C"
import (
"fmt"
"github.com/cnlh/nps/client"
"time"
)
//export PrintBye
func PrintBye() {
fmt.Println("From DLL: Bye!")
}
var status bool
//export Sum
func StartClientByVerifyKey(a int, b int) bool {
c := client.NewRPClient(*serverAddr, *verifyKey, *connType, *proxyUrl, nil)
go func() {
for {
status = true
c.Start()
status = false
time.Sleep(time.Second * 5)
}
}()
return true
}
func main() {
// Need a main function to make CGO compile package as C shared library
}