Re: send() returns error even though data is sent, TCP connection still alive
- From: Garrett Wollman <wollman@xxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Jan 2007 15:04:57 -0500 (EST)
In article <1170269163.22436.71.camel@xxxxxxxxxxxxx>,
Jeff Davis <freebsd@xxxxxxxxxxx> wrote:
You should see something like "write failed: host is down" and the
session will terminate. Of course, when ssh exits, the TCP connection
closes. The only way to see that it's still open and active is by
writing (or using) an application that ignores EHOSTDOWN errors from
write().
I agree that it's a bug. The only time write() on a stream socket
should return the asynchronous error[1] is when the connection has
been (or is in the process of being) torn down as a result of a
subsequent timeout. POSIX says "may fail" for these errors write()
and send() on sockets
-GAWollman
[1] There are two kinds of error returns in the socket model:
synchronous errors, like synchronous signals, are attributed to the
result of a specific system call, detected prior to syscall return,
and usually represent programming or user error (e.g., attempting to
connect() on an fd that is not a socket). Asynchronous errors are
detected asynchronously, and merely posted to the socket without being
delivered; they may be delivered on the next socket operation. See
XSH 2.10.10, "Pending Error".
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Prev by Date: Re: [TEST ATTACHED] Inconsistencies with IP_ONESBCAST and/or IP_SENDSRCADDR
- Next by Date: fxp(4) checksum (offloading?) errors
- Previous by thread: [TEST ATTACHED] Inconsistencies with IP_ONESBCAST and/or IP_SENDSRCADDR
- Next by thread: Re: send() returns error even though data is sent, TCP connection still alive
- Index(es):
Relevant Pages
|
|