我在任务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]
我要赚赏金打赏帖 |
|
|---|---|
| 片外存储Flash使用方法(Arduino IDE环境)被打赏¥22元 | |
| 三分钟快速上手ESP-NOW(ArduinoIDE环境)被打赏¥23元 | |
| 【S32K3XX】LPSPI参数配置说明被打赏¥21元 | |
| 在WT9932C61-TINY上实现超声波测距被打赏¥22元 | |
| 基于WT9932C61-TINY的环境构建及OLED屏驱动测试被打赏¥20元 | |
| 【S32K3XX】Core-to-Core 中断使用被打赏¥21元 | |
| 「AI编程记录--含源码」用一晚上的时间写一个esp32的示波器被打赏¥19元 | |
| STM32C0116DK开发探索记(3)被打赏¥30元 | |
| STM32C0116DK开发探索记(2)被打赏¥24元 | |
| STM32C0116DK开发探索记(1)被打赏¥29元 | |
我要赚赏金
