v0.6.0
Added
netchan_disconnect(): queue a DISCONNECT for the peer and enter CLOSING,
without freeing. netchan has no socket of its own, so a caller must run one
netchan_send_nextcycle to put the frame on the wire, thennetchan_close
to free. This is the graceful-shutdown counterpart tonetchan_close, which
frees without telling the peer anything. It does nothing unless the session
is CONNECTED, and the frame is best effort: it goes out once, unreliably,
and is not retransmitted, so a lost datagram leaves the peer waiting out its
idle timeout as before.
Changed
netchan_closeno longer queues a DISCONNECT. It wrote the frame into a
buffer the same call then freed, so nothing ever reached the wire, and the
dead write made close read like a graceful shutdown.
Fixed
- The transport wrappers closed a live connection with
netchan_closealone,
so nothing told the peer the link had ended and it waited out its idle
timeout, seconds later, to notice.secure_link_close,auth_link_close,
and the chat example now callnetchan_disconnect, flush, then
netchan_close, so a peer sees a clean shutdown at once. A program that
copied one of these wrappers as its starting point inherited the delay; that
is exactly how it was found downstream.
Vendoring
curl -fsSL https://raw.githubusercontent.com/OrangeTide/netchan/v0.6.0/tools/vendor.sh | sh -s -- --version v0.6.0The source snapshot below is what that fetches. See
VENDORING.md.