From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,9844192819222b6 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-07-21 13:53:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.algonet.se!algonet!newsfeed1.bredband.com!bredband!uio.no!newsfeed1.uni2.dk!news.cybercity.dk!news.isjsys.aask.dk!isjsys From: Ivan Skytte =?iso-8859-1?Q?J=F8rgensen?= Newsgroups: comp.unix.tru64 Subject: Re: [asking] recvfrom function is not blocking.. please help me.. Date: Sun, 21 Jul 2002 22:53:18 +0200 Organization: Cybercity Message-ID: <3D3B1F3E.9E67BD63@image.dk> References: <49c26d69.0207210638.78c9efd0@posting.google.com> NNTP-Posting-Host: port80.ds1-hk.adsl.cybercity.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.cybercity.dk 1027284785 24092 212.242.60.147 (21 Jul 2002 20:53:05 GMT) X-Complaints-To: abuse@cybercity.dk NNTP-Posting-Date: Sun, 21 Jul 2002 20:53:05 +0000 (UTC) X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.7-10 i686) X-Accept-Language: da, en, de X-NNTP-Posting-Host: 127.0.0.1 (isjsys) Xref: archiver1.google.com comp.unix.tru64:8182 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?