Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - recvfrom is blocking: Page 1 of 10 (10 Items)
   
recvfrom is blocking  
Hi,

I am trying to capture ICMP ping packets. 
Using socket(AF_INET, SOCK_DGRAM, 1), the call the recvfrom blocks even when i ping the machine running the 
application(x86 using io-pkt-hc).

here is the code after socket creation.

memset(&daddr, 0, sizeof(daddr));
addrlen = sizeof(daddr);
printf("Waiting...\n");
/*THIS CALL JUST HANGS*/
if ((recvfrom(s, buf, 100, 0, (struct sockaddr *)&daddr, &addrlen))==-1)
{
              	printf("Receive error: %s\n", strerror(errno));
               	continue;
}
printf("Packet received: ");

Can anyone help me out?

Thanks,
Jayanth