Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: "Ivan Skytte Jørgensen" <isj@dont_forget_to_remove_this.image.dk.invalid>
Subject: Re: [asking] recvfrom function is not blocking.. please help me..
Date: Sun, 21 Jul 2002 22:53:18 +0200	[thread overview]
Message-ID: <3D3B1F3E.9E67BD63@image.dk> (raw)
In-Reply-To: 49c26d69.0207210638.78c9efd0@posting.google.com

Gijung Kim wrote:
> 
>  pktlen = recvfrom(sockfd, rbuf, sizeof(rbuf), 0,
>                    recvaddr, (socklen_t *)sizeof(struct sockaddr));

The last parameter is wrong. Declare a variable of type socklen_tm
initialize it with sizeof(sockaddr) and pass a pointer to it as the
last parameter in recvfrom()


>                 if (pktlen < 0)
>                         perror("recvfrom error");

You forgot to show us what the error is, but I suspect that it would
have shown EFAULT "Bad address"


I have no idea of why it would even work on Linux. Are you sure you
are using the same source code on both OSes?


      reply	other threads:[~2002-07-21 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-21 14:38 [asking] recvfrom function is not blocking.. please help me Gijung Kim
2002-07-21 20:53 ` Ivan Skytte Jørgensen [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox