Re: select refuses connection with datagrams

Keith Owens (kaos@ocs.com.au)
Sat, 03 Oct 1998 23:03:12 +1000


On Thu, 01 Oct 1998 16:04:25 -0700,
Mark Hamilton <mark@rti.com> wrote:
>I have noticed a problem with Linux that has existed for the last couple
>of years. It involves basic networking functionality. I have tried for a
>long time to figure out what is wrong but I just can not figure out the
>problem. Basically, if you send a datagram with the function sendto you
>periodically get the error "Connection refused".

This almost qualifies as a FAQ.

Alan Cox posted some mail November 1997 on this subject, basically
saying that it is required by RFC 1122. The destination responds with
ICMP port or host unreachable, a pending error is stored, the next send
gets an error. To handle it, if write gets ECONNREFUSED, retry a
couple of times. The initial question and Alan's response can be found
in

http://linuxwww.db.erau.edu/mail_archives/linux-kernel/Nov_97/1634.html
http://linuxwww.db.erau.edu/mail_archives/linux-kernel/Nov_97/1647.html

-
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/