linux-mips
[Top] [All Lists]

Re: Socket problem?

To: linux-mips@linux-mips.org
Subject: Re: Socket problem?
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Date: Sat, 22 May 2004 18:06:35 +0200
In-reply-to: <000001c43fd3$2c25a350$2000a8c0@gillpc>
Mail-followup-to: linux-mips@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <000001c43fd3$2c25a350$2000a8c0@gillpc>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.5.1+cvs20040105i
On Sat, 2004-05-22 09:02:48 +0100, Gill <gill.robles@exterity.co.uk>
wrote in message <000001c43fd3$2c25a350$2000a8c0@gillpc>:
> Hi -
> 
> Has anyone come across a socket problem where the user app calls select() on
> a set of sockets, which returns, indicating that data is waiting...then
> subsequent recvfrom() call returns -1 indicating that there's nothing
> there??

Read the select() manpage again. Upon successful return, it's guaranteed
that the very next read() on a file descriptor contained in the result
set won't block. Typically, it's the case after data arrived, but
returning -1 *immediately* (with no blocking) is okay, too.

> I'm using linux v2.4.2, IPv4, and the ethernet driver is pcnet32.  We're
> receiving a UDP stream.

Quite aged version, though perfectly correct on select() behaviour.

> I'm trying to check for dropped packets.  /proc/net/snmp indicates a number
> of UDP InErrors (~1 per second).  However, not yet sure whether this is a
> consequence of the problem above, or cause of it.

Neither - nor. You've got a small thinko in your application. Albeit
that: update your kernel version... It most probably contains a number
of known root exploits.

MfG, JBG

-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +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));

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>