if((g_net_data.socket = socket(AF_AT, SOCK_STREAM, 0)) == -1)
{
LOG_E("Create socket failed!");
return RT_FALSE;
}
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(port);
server_addr.sin_addr = *((struct in_addr *)host->h_addr);
rt_memset(&(server_addr.sin_zero), 0, sizeof(server_addr.sin_zero));
rt_thread_mdelay(5000);
if(connect(g_net_data.socket, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)) == -1)
{
LOG_E("Connect failed!n");
return RT_FALSE;
}
是这样走的,没经过那个函数
if((g_net_data.socket = socket(AF_AT, SOCK_STREAM, 0)) == -1)
{
LOG_E("Create socket failed!");
return RT_FALSE;
}
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(port);
server_addr.sin_addr = *((struct in_addr *)host->h_addr);
rt_memset(&(server_addr.sin_zero), 0, sizeof(server_addr.sin_zero));
rt_thread_mdelay(5000);
if(connect(g_net_data.socket, (struct sockaddr *)&server_addr, sizeof(struct sockaddr)) == -1)
{
LOG_E("Connect failed!n");
return RT_FALSE;
}
是这样走的,没经过那个函数
举报