Commit 42c73a98 authored by 黄振令's avatar 黄振令

【修改内容】tcp 发送增加保护

【提交人】huang.zhenling
parent 7d285570
......@@ -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)
{
......
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