Commit 69b9cbf0 authored by chen.weican's avatar chen.weican
parents 02c29df5 9a357ca2
......@@ -645,14 +645,20 @@ int kk_tcp_client_send(char* data, int len){
sleep(1);
cnt++;
}
if (g_client_ctrl.sd < 0){
printf("[%s] The tcp socket created fialid !!!! \n",__FUNCTION__);
return -1;
}
_MutexLock(g_client_ctrl.mutex);
ret = write(g_client_ctrl.sd, data, len);
_MutexUnlock(g_client_ctrl.mutex);
if (ret < 0){
printf("[%s] write failed ret=%d, reconnect !!!! \n",__FUNCTION__, ret);
g_client_ctrl.isConnect = 0;
ret = -1;
}
}
return ret;
}
int kk_tcp_client_init(char ip[MAX_IP_LEN], int port, ipc_cb cb)
{
......
......@@ -479,6 +479,9 @@ void ipcHandle(void)
//send add gw to ccu
char* outbuf = _msg_topo_add();
if (strcmp(GW2CCU_PROTOCOL, "tcp") != 0){
printf("check nanomsg is connect(%d) \n", kk_ipc_isconnect(IPC_PLAT2MID));
}
kk_sendData2CCU(outbuf, strlen(outbuf));
free(outbuf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment