summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2014-12-17 08:24:33 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2014-12-17 08:24:33 (GMT)
commit15c997652618cddb535425357ee290c48f25db5b (patch)
tree965fd82f8c22b9bb8ad71274378591d94b4d7569
parent2933029b8c2dfc2e4a8bd89cacad8aa53099d5d4 (diff)
parentd7699753fccbdc293c9e954833f62e623b5cbfd1 (diff)
downloadtcl-15c997652618cddb535425357ee290c48f25db5b.zip
tcl-15c997652618cddb535425357ee290c48f25db5b.tar.gz
tcl-15c997652618cddb535425357ee290c48f25db5b.tar.bz2
TIP-427: make "fconfigure $h -connecting" official (client sockets only)
-rw-r--r--doc/socket.n9
-rw-r--r--unix/tclUnixSock.c2
-rw-r--r--win/tclWinSock.c4
3 files changed, 12 insertions, 3 deletions
diff --git a/doc/socket.n b/doc/socket.n
index b7a4a45..492ca66 100644
--- a/doc/socket.n
+++ b/doc/socket.n
@@ -97,6 +97,10 @@ writable channel event on the socket to get notified when the
asynchronous connection has succeeded or failed. See the \fBvwait\fR
and the \fBchan\fR commands for more details on the event loop and
channel events.
+.PP
+The \fBchan configure\fR option \fB-connecting\fR may be used to check if the connect is still running. To verify a successful connect, the option \fB-error\fR may be checked when \fB-connecting\fR returned 0.
+.PP
+Operation without the event queue requires at the moment calls to \fBchan configure\fR to advance the internal state machine.
.RE
.SH "SERVER SOCKETS"
.PP
@@ -186,6 +190,11 @@ sockets, this option returns a list of three elements; these are the
address, the host name and the port to which the peer socket is connected
or bound. If the host name cannot be computed, the second element of the
list is identical to the address, its first element.
+.RE
+.TP
+\fB\-connecting\fR
+.
+This option is not supported by server sockets. For client sockets, this option returns 1 if an asyncroneous connect is still in progress, 0 otherwise.
.PP
.SH "EXAMPLES"
.PP
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 0188ea6..9c5cd4b 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -905,7 +905,7 @@ TcpGetOptionProc(
}
if (len > 0) {
- return Tcl_BadChannelOption(interp, optionName, "peername sockname");
+ return Tcl_BadChannelOption(interp, optionName, "connecting peername sockname");
}
return TCL_OK;
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index f5658ba..a022ed5 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -1501,9 +1501,9 @@ TcpGetOptionProc(
if (len > 0) {
#ifdef TCL_FEATURE_KEEPALIVE_NAGLE
return Tcl_BadChannelOption(interp, optionName,
- "peername sockname keepalive nagle");
+ "connecting peername sockname keepalive nagle");
#else
- return Tcl_BadChannelOption(interp, optionName, "peername sockname");
+ return Tcl_BadChannelOption(interp, optionName, "connecting peername sockname");
#endif /*TCL_FEATURE_KEEPALIVE_NAGLE*/
}