void task_client_handle()
{
fd_set fdset;
while(1)
{
FD_SERO(&fdset);//clear fd_set
FD_SET(sockfd,&fdset); //将sockfd添加到fset集合中
struct timeval timeout = {5,0};//5妙超时时间
int n = select(sockfd,&fdset,NULL.NULL,&timeout);
if(n <= 0)
{ //port_task_delay(1000);
port_debug("select n <= 0,time out ,waiting....\n");
}
else
{
if(FD_ISSET(sockfd,&fdset))
{
port_take_mutex();
int count = recvFromSer(client_buf,NETWORK_RECV_SIZE);
port_give_mutex();
if (count > 0)
{
port_debug("recv count: %d ", count);
channel_recv_data(client_buf, count);
}
}
}
}
}