ConnectionSendConformanceSuite

What Connection.send owes its caller once the link behind it has died.

The link is gone, so the frame cannot go anywhere. The only question is how the caller hears about it, and the answer has to be an ordinary exception. MeshSeam and LinkSeam both evict a dead link from the failure of send, through a guard that rethrows any CancellationException, so a link that reports its death as a cancellation is never evicted, and the coroutine that tried to send is cancelled rather than failed. Nothing logs it and nothing handles it.

Subclass this once per real transport and per way that transport can die, and return from deadLink a link that really has died. There is no in-memory reference binding on purpose: connectionPair drops a frame sent after a close and returns normally, so it cannot reach the failure this suite is about. A bare session.send over a closed Ktor session could, and did, which is why the bindings are real sessions and real sockets.

What it does not reach

Nothing here sends into a link that dies while the send is suspended, because a binding needs a transport-specific way to hold a send there. Nothing calls Connection.close, and nothing collects Connection.incoming.

Constructors

Link copied to clipboard
constructor()

Functions

A caller that nobody cancelled hears about a dead link through an ordinary exception.

The converse, and what stops a fix for the first property overshooting: converting every cancellation into a plain exception would hide the caller's own, and the caller would then carry on as though it were still running.