<p>How does TCP/IP report errors when packet delivery fails permanently? All Socket.write() APIs I've seen simply pass bytes to the underlying TCP/IP output buffer and transfer the data asynchronously. How then is TCP/IP supposed to notify the developer if packet delivery fails permanently (i.e. the destination host is no longer reachable)?</p>

<p>Any protocol that requires the sender to wait for confirmation from the remote end will get an error message. But what happens for protocols where a sender doesn't have to read any bytes from the destination? Does TCP/IP just fail silently? Perhaps Socket.close() will return an error? Does the TCP/IP specification say anything about this?</p>

The sockets API has no way of informing the writer exactly how many bytes have been received as acknowledged by the peer.  There are no guarantees made by the presence of a successful
```
shutdown
```
or
```
close
```
either.
The TCP/IP specification says nothing about the application interface (which is nearly always the sockets API).
SCTP
is an alternative to TCP which attempts to address these shortcomings, among others.