Jump to ID:
Networking

Project Home

Discussions

Wiki

Project Info
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