lkml.org 
[lkml]   [1998]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ECONNREFUSED in recvfrom ?
On Mon, Oct 12, 1998 at 03:25:34PM +0200, Davide Rossetti wrote:

> hi all,
> i'm stuck with a strange (for me) behaviour of recvfrom with UDP sockets.
> 1) in the man page, this error code is not documented (ok, they are rather
> old)
> 2) the sequence I try is that of a simple echo server (only for test):
>
> create AD_DGRAM socket
> while(select for fd with timeout==-1) {
> recvfrom(addr, buf, ...);
> sendto(addr, buf, ...)
> }
>
> the first time ok. I send a packet from another host, recv and send are
> done. but instead of going back to sleep, it wakes up again and gets an
> ECONNREFUSED error in recvfrom.

A previous packet you sent on that socket was sent to a host that
wasn't listening, it sent back and ICMP packet to this effect and it
gets reported later on...

Have a look at what's going on with tcpdump to see what I mean if my
explanation isn't clear (alan has a clearly explanation that mine).


-cw

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.100 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site