我在任务A中向一pipe写数据,在另一任务内读,数据都读到了,但write还是不返回,为什么?程序部分代码如下
任务A
ioctl(udpSendPipeId,FIONMSGS,(int)&msg_num);
if(msg_num<HEART_PIPE_MSG_NUM)
{
logMsg("write begin !\n");
write(udpSendPipeId,buf,28);
logMsg("write end!\n");
}
任务B
FD_ZERO(&read_set);
FD_ZERO(&write_set);
FD_SET(udp_recv_socket,&read_set);;
FD_SET(udpSendPipeId,&read_set);
selectNum=select(FD_SETSIZE,&read_set,(fd_set *)0,(fd_set *)0,&wait);
if(selectNum==0)
{
logMsg("Error 0:udp_task select()\n");
continue;
}
if(FD_ISSET(udpSendPipeId,&read_set))
{
if((udp_len=read(udpSendPipeId,buf,100))>0)
{
logMsg("SendPipe receive len %d > 0 \n",udp_len);
.......
}
}
[align=right][color=#000066][此贴子已经被作者于2004-7-6 16:41:30编辑过][/color][/align]
打赏帖 | |
---|---|
【OZONE】使用方法总结被打赏20分 | |
【S32K314】芯片启动流程分析被打赏20分 | |
【LP-MSPM0L1306】适配 RT-Thread Nano被打赏20分 | |
今天的咸鱼也是曾经鱼跃龙门的天纵之才,中流击水,浪遏飞舟,粪土当年万户侯,数风流人物,还看今朝,被打赏5分 | |
分享一种检测按键状态的方法被打赏20分 | |
周末总结一下,STM32C0系列的开发经验被打赏50分 | |
【换取手持数字示波器】MicrochipMPLABHarmony框架下定时器配置被打赏20分 | |
【换取手持数字示波器】MicrochipMPLABHarmony框架下PWM配置被打赏20分 | |
【Cortex-M】Systick Timer使用被打赏10分 | |
分享汽车防盗系统的组成与分类(一)被打赏5分 |