Bug 33081

Summary: send(2) sometimes yields ECONNREFUSED, but it's not documented
Product: Documentation Reporter: Ronald F. Guilmette <rfg>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Ronald F. Guilmette 2001-12-22 06:00:01 UTC
	Using send(2) on a previously connected DGRAM socket, I am getting
	an error result with error set to ECONNREFUSED, but this possible
	result isn't documented on the send(2) man page.

Fix: 

Edit the ERRORS section of the send(2) man page to indicate that
	an ECONNREFUSED value in errno is a possible outcome of a call to
	send(2) (and maybe also the other functions described on this page).
How-To-Repeat: 	Create a DGRAM socket and connect it to some host/port that
	doesn't have anything bound to that port, and that has nothing
	which will be listening for incoming UDP datagrams on that port.
	Then just use send(2) to try to send a packet to that host/port
	and check errno afterwards.
Comment 1 Peter Pentchev 2001-12-25 18:27:31 UTC
On Fri, Dec 21, 2001 at 09:56:25PM -0800, rfg@monkeys.com wrote:
> 
> >Number:         33081
> >Category:       docs
> >Synopsis:       send(2) sometimes yields ECONNREFUSED, but it's not documented
> >Originator:     Ronald F. Guilmette
> >Release:        FreeBSD 4.3-RELEASE i386
> >Organization:
> Infinite Monkeys & Co.
> >Environment:
> 	FreeBSD 4.3-RELEASE
> 
> >Description:
> 	Using send(2) on a previously connected DGRAM socket, I am getting
> 	an error result with error set to ECONNREFUSED, but this possible
> 	result isn't documented on the send(2) man page.

I think this was fixed in rev. 1.13, committed on May 20, 2001.
I might be wrong, but my 4.4-STABLE send(2) manual page has the following
in the ERRORS section:

[ECONNREFUSED]     The socket received an ICMP destination unreachable
                   message from the last message sent.  This typically
                   means that the receiver is not listening on the remote
                   port.

This was even in 4.4-RELEASE :)

G'luck,
Peter

-- 
This sentence would be seven words long if it were six words shorter.
Comment 2 Peter Pentchev freebsd_committer freebsd_triage 2001-12-25 19:31:03 UTC
State Changed
From-To: open->feedback

Are you satisfied with the text from rev. 1.13, quoted in my message 
in the audit-trail?
Comment 3 Peter Pentchev freebsd_committer freebsd_triage 2002-01-07 01:49:01 UTC
State Changed
From-To: feedback->closed

Feedback timeout; besides, this is actually corrected in 
latter FreeBSD versions.