summaryrefslogtreecommitdiffstats
path: root/tests/socket.test
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2014-10-17 12:52:15 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2014-10-17 12:52:15 (GMT)
commitfc47c8aae5f8c68455ee588cfbe4f707e91bde7d (patch)
treebe3de78d31378f969e402b18be8388fe7ba20689 /tests/socket.test
parentceff856085045650b5b10e2d2fea1355ba78e4c4 (diff)
parenta9606871f5ddb7d6a8cd69f3fa0c41fe8b3c0396 (diff)
downloadtcl-fc47c8aae5f8c68455ee588cfbe4f707e91bde7d.zip
tcl-fc47c8aae5f8c68455ee588cfbe4f707e91bde7d.tar.gz
tcl-fc47c8aae5f8c68455ee588cfbe4f707e91bde7d.tar.bz2
fconfigure -peername and -sockname return empty string while async connect running.
Diffstat (limited to 'tests/socket.test')
-rw-r--r--tests/socket.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/socket.test b/tests/socket.test
index c50730c..d6cee30 100644
--- a/tests/socket.test
+++ b/tests/socket.test
@@ -2321,6 +2321,28 @@ test socket-14.15 {blocking read on async socket should not trigger event handle
set x
} -result ok
+# v4 and v6 is required to prevent that the async connect does not terminate
+# before the fconfigure command. There is always an additional ip to try.
+test socket-14.16 {empty -peername while [socket -async] connecting} \
+ -constraints {socket localhost_v4 localhost_v6} \
+ -body {
+ set client [socket -async localhost [randport]]
+ fconfigure $client -peername
+ } -cleanup {
+ catch {close $client}
+ } -result {}
+
+# v4 and v6 is required to prevent that the async connect does not terminate
+# before the fconfigure command. There is always an additional ip to try.
+test socket-14.17 {empty -sockname while [socket -async] connecting} \
+ -constraints {socket localhost_v4 localhost_v6} \
+ -body {
+ set client [socket -async localhost [randport]]
+ fconfigure $client -sockname
+ } -cleanup {
+ catch {close $client}
+ } -result {}
+
set num 0
set x {localhost {socket} 127.0.0.1 {supported_inet} ::1 {supported_inet6}}