Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <000801c28bf8$d99d9a50$0164a8c0@PROJECTTECHNOLOGY1>
From: "Dr. M. C. Nelson" <mcnelson@mindspring.com>
To: "Thomas Pfaff" <tpfaff@gmx.net>
Cc: <cygwin@cygwin.com>
References: <002001c28b93$f5bb6e70$0164a8c0@PROJECTTECHNOLOGY1> <3DD396F9.5000905@gmx.net>
Subject: Re: recvfrom bug
Date: Thu, 14 Nov 2002 11:14:00 -0500
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300

Thank you.  I will try that.

----- Original Message -----
From: "Thomas Pfaff" <tpfaff@gmx.net>
To: <mcnelson@mindspring.com>
Cc: <cygwin@cygwin.com>
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/

