Skip to content

Commit 72d57de

Browse files
author
Tal Hadad
committed
ignore errors on TCP disconnecting in the R side
1 parent 0460b3d commit 72d57de

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

R/session/vsc.R

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -962,8 +962,12 @@ print.hsearch <- function(x, ...) {
962962
}
963963

964964
reg.finalizer(.GlobalEnv, function(e) {
965-
.vsc$request("detach")
966-
if (!is.na(request_tcp_connection)) {
967-
close(request_tcp_connection)
968-
}
965+
# TODO: When exiting radian by EOF("CTRL+D") when coonecting to vsc by TCP,
966+
# the TCP connection is getting closed before we're able to call detach...
967+
tryCatch({
968+
.vsc$request("detach")
969+
if (!is.na(request_tcp_connection)) {
970+
close(request_tcp_connection)
971+
}
972+
}, error = function(e) NULL)
969973
}, onexit = TRUE)

0 commit comments

Comments
 (0)