From cf08436e055be80eeb5d0e22b3ab709e7c84e3b2 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 30 Apr 2019 11:02:08 -0600 Subject: [PATCH] cs: fix custodian shutdown of TCP to use `shutdown` In other words, send an EOF over TCP on custodian shutdown. --- racket/src/io/port/fd-port.rkt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/racket/src/io/port/fd-port.rkt b/racket/src/io/port/fd-port.rkt index bb5f4d430c..6be1f68845 100644 --- a/racket/src/io/port/fd-port.rkt +++ b/racket/src/io/port/fd-port.rkt @@ -437,6 +437,9 @@ (lambda (fd) (when flush-handle (plumber-flush-handle-remove! flush-handle)) + (if (input-port? port) + (send fd-input-port port on-close) + (send fd-output-port port on-close)) (fd-close fd fd-refcount) (set-closed-state! port)) #f