lkml.org 
[lkml]   [1999]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectUDP sendto/recvfrom error
Hi,
I hope someone can help to tell me why I met this error.
------------------OK---------------
int client_len;
int n=0;
while(1)
{
if (n=recvfrom(sockfd,buffer,size,0,pclient_addr,&client_len))<=0)
printf("error");
sendto(.....)
}
------------------ recvfrom error-----------
int n=0;
int client_len;
while(1)
{
if (n=recvfrom(sockfd,buffer,size,0,pclient_addr,&client_len))<=0)
printf("error");
sendto(.....)
}
------------------

I found if I declare the int client_len right before the while loop, the
recvfrom fucntion will return the "Invalid Argument" (22) error. But it
works fine if I declare one of more variable after client_len.

Thanks! I appreciate your help.

Tracy




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.023 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site