+ /*
+ * Eventually, PuTTY should close down each session as it exits,
+ * so there should be no sockets left when we get here. Still,
+ * better safe than sorry.
+ *
+ * XXX What about in-flight aync I/O (when we support that)?
+ */
+ for (s = mactcp.socklist; s != NULL; s = next) {
+ next = s->next; /* s is about to vanish */
+ mactcp_close(&s->fn);
+ }
+
+ /*
+ * When we get async DNS, we have to wait for any outstanding
+ * requests to complete here before exiting.
+ */