Thank you. I will try that. ----- Original Message ----- From: "Thomas Pfaff" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, November 14, 2002 7:28 AM Subject: Re: recvfrom bug
> Dr. M. C. Nelson wrote: > > Dear mailing list: > > > > The following code works well on a Linux platform, > > > > int sockfd; > > char buf[1024]; > > struct sockaddr fromaddr; > > int fromlen; > > > > if ( (retv = recvfrom( sockfd, buf, sizeof(buf), 0, &fromaddr,&fromlen )) < > > 0 ) > > { > > perror( "udpclient: recvfrom" ); > > } > > > > However, in cygwin the following error message is produced: > > > > udpclient: recvfrom: Bad address > > > > Can anyone tell me how to get pas this problem? > > You must initialize fromlen with sizeof(fromaddr) prior to recvfrom. > > int fromlen = sizeof(fromaddr). > > Thomas > > > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/