summaryrefslogtreecommitdiffstats
path: root/doc/chan.n
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-05-22 10:13:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-05-22 10:13:42 (GMT)
commitb9722ec35665151ee849b8823f0502b4d5c29b4a (patch)
tree5a5a9cb0cfd0f016b3eaf6b07d611d305b23c876 /doc/chan.n
parentf1e62884ba8effddf2824d816abf7e271de6d6f8 (diff)
parentf3f254e8bab8854467fda3c5a2c48a640fb7687c (diff)
downloadtcl-b9722ec35665151ee849b8823f0502b4d5c29b4a.zip
tcl-b9722ec35665151ee849b8823f0502b4d5c29b4a.tar.gz
tcl-b9722ec35665151ee849b8823f0502b4d5c29b4a.tar.bz2
Merge 8.7
Diffstat (limited to 'doc/chan.n')
-rw-r--r--doc/chan.n19
1 files changed, 16 insertions, 3 deletions
diff --git a/doc/chan.n b/doc/chan.n
index 62121d1..538f86d 100644
--- a/doc/chan.n
+++ b/doc/chan.n
@@ -55,7 +55,9 @@ channel is flushed in the background before finally being closed.
.PP
\fBchan close\fR may return an error if an error occurs while flushing
output. If a process in a command pipeline created by \fBopen\fR returns an
-error, \fBchan close\fR generates an error in the same manner as \fBexec\fR.
+error (either by returning a non-zero exit code or writing to its standard
+error file descriptor), \fBchan close\fR generates an error in the same
+manner as \fBexec\fR.
.PP
Closing one side of a socket or command pipeline may lead to the shutdown() or
close() of the underlying system resource, leading to a reaction from whatever
@@ -70,6 +72,17 @@ description of channel sharing.
.PP
When the last interpreter sharing a channel is destroyed, the channel is
switched to blocking mode and fully flushed and then closed.
+.PP
+Channels are automatically closed when an interpreter is destroyed and
+when the process exits.
+From 8.6 on (TIP#398), nonblocking channels are no longer switched to
+blocking mode when exiting; this guarantees a timely exit even when the
+peer or a communication channel is stalled. To ensure proper flushing of
+stalled nonblocking channels on exit, one must now either (a) actively
+switch them back to blocking or (b) use the environment variable
+\fBTCL_FLUSH_NONBLOCKING_ON_EXIT\fR, which when set and not equal to
+.QW \fB0\fR
+restores the previous behavior.
.RE
.TP
\fBchan configure \fIchannelName\fR ?\fIoptionName\fR? ?\fIvalue\fR? ?\fIoptionName value\fR?...
@@ -348,8 +361,8 @@ first words of a command that provides the interface for a \fBrefchan\fR.
\fBImode\fR is a list of one or more of the strings
.QW \fBread\fR
or
-.QW \fBwrite\fR
-, indicating whether the channel is a read channel, a write channel, or both.
+.QW \fBwrite\fR ,
+indicating whether the channel is a read channel, a write channel, or both.
It is an error if the handler does not support the chosen mode.
.PP
The handler is called as needed from the global namespace at the top level, and