OK, thanks. Looks like the problem was that udp found checksum problems, and threw bad packets away. Underlying problem was that the network driver was reading from cached memory - but data was being DMA-ed into uncached memory. Invalidating data cache for receive buffers before reading from them has fixed the problem. Cheers, Gill -----Original Message----- From: linux-mips-bounce@xxxxxxxxxxxxxx [mailto:linux-mips-bounce@xxxxxxxxxxxxxx] On Behalf Of Jan-Benedict Glaw Sent: 24 May 2004 10:14 To: linux-mips@xxxxxxxxxxxxxx Subject: Re: Socket problem? On Mon, 2004-05-24 09:25:43 +0100, Gill <gill.robles@xxxxxxxxxxxxxx> wrote in message <000501c44168$b4718800$2000a8c0@gillpc>: > Hi - > > To clarify, more specifically select() returns a positive value, and a > subsequent call to FD_ISSET() returns TRUE for one of the sockets the > app is listening on. Then, app calls recvfrom() which returns > (sometimes) -1. Problem occurs sporadically...I'm seeing it every > hundred or so packets at the moment, but it varies. That sounds perfectly okay. >From SuS V3: ------------------------------------------------------------------- A descriptor shall be considered ready for reading when a call to an input function with O_NONBLOCK clear would not block, whether or not the function would transfer data successfully. (The function might return data, an end-of-file indication, or an error other than one indicating that it is blocked, and in each of these cases the descriptor shall be considered ready for reading.) ------------------------------------------------------------------- So everything is perfectly okay, and because you have to do proper error checking anyways, that shouldn't disturb your application at all. MfG, JBG -- Jan-Benedict Glaw jbglaw@xxxxxxxxxx . +49-172-7608481 "Eine Freie Meinung in einem Freien Kopf | Gegen Zensur | Gegen Krieg fuer einen Freien Staat voll Freier Bürger" | im Internet! | im Irak! ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));