Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: atacama.four-d.de: mail set sender to using -f Message-ID: <3DD396F9.5000905@gmx.net> Date: Thu, 14 Nov 2002 13:28:41 +0100 From: Thomas Pfaff User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 To: mcnelson AT mindspring DOT com CC: cygwin AT cygwin DOT com Subject: Re: recvfrom bug References: <002001c28b93$f5bb6e70$0164a8c0 AT PROJECTTECHNOLOGY1> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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/