http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

TheGrumpyProgrammer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gameprogrammer] Re: recvfrom returning 0 on UDP and blocking



It turned out to be Zone Alarm was causing the problem.  When I turned it
off things worked correctly again.  Basically, recvfrom was returning 0 with
data on the sender port rather than the reciever port.  I guess it thinks
127.0.0.1 is always to any used port rather than to the designated port.

----- Original Message -----
From: "Neil Griffiths" <neil@ngriff.co.uk>
To: <gameprogrammer@freelists.org>
Sent: Wednesday, June 23, 2004 12:07 PM
Subject: [gameprogrammer] Re: recvfrom returning 0 on UDP and blocking


> IIRC, it's because it's possible that the previous recvfrom() didn't
> flush the buffers properly and so the next time you call it to block, it
> will return 0 (as in no data - not a disconnect which is impossible with
> UDP as you know).
>
> Why are you blocking anyway, is there any reason you're not using a
> FD_SET ?
>
> Neil



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html