ticker := time.NewTicker(time.Duration(1) * time.Second)
defer func() { ticker.Stop() }()
+ var ip string
+
for {
select {
case <-ticker.C:
- log.Println("pollGettingOutBoundIP")
- ip, gPollingError := common.GetOutboundIP()
+ ip, gPollingError = common.GetOutboundIP()
+ log.Println("pollGettingOutBoundIP : ", gPollingError)
if len(ip) != 0 {
return ip, gPollingError
}
errCode = 0
- log.Println(logPrefix, "orchestration init done")
-
//NOTE : CMain work init thread and requestservice thread seperatly.
//NOTE : Need Ready variable.
orcheEngine.Ready = true
+ log.Println(logPrefix, "orchestration init done")
+
+
return
}
//export OrchestrationRequestService
-func OrchestrationRequestService(cAppName *C.char, cArgs *C.char) (handle C.int) {
+func OrchestrationRequestService(cAppName *C.char, cArgs *C.char) C.int {
log.Printf("[%s] OrchestrationRequestService", logPrefix)
appName := C.GoString(cAppName)
}
log.Println("appName:", appName, "args:", argsArr)
- orchestrationapi.RequestService(appName, argsArr)
-
- errCode := 0
+ handle := orchestrationapi.RequestService(appName, argsArr)
+ log.Printf("requestService handle : %d\n", handle)
- return C.int(errCode)
+ return C.int(handle)
}
var count int
func RequestService(appName string, args []string) (handle int) {
if orcheEngine.Ready == false {
- log.Println("AAAAAAAAADASDADDDS")
return errormsg.ErrorNotReadyOrchestrationInit
}
serviceClient := addServiceClient(handle, appName, args)
go serviceClient.listenNotify()
endpoints, err := getEndpointDevices(appName)
- log.Println("getttttttttttttttEndpointDevicessssssssssss ", err)
- log.Println(errormsg.ErrorTurnOffWifi)
- log.Println(errormsg.ErrorDisconnectWifi)
if err != nil {
return errormsg.ToInt(err)
}