summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/chanio.test11
-rw-r--r--tests/io.test11
2 files changed, 12 insertions, 10 deletions
diff --git a/tests/chanio.test b/tests/chanio.test
index 179d7a7..b80c926 100644
--- a/tests/chanio.test
+++ b/tests/chanio.test
@@ -7279,22 +7279,23 @@ test chan-io-53.10 {Bug 1350564, multi-directional fcopy} -setup {
}
chan puts stderr SRV
set l {}
- set srv [socket -server new 9999]
+ set srv [socket -server new -myaddr 127.0.0.1 0]
+ set port [lindex [chan configure $srv -sockname] 2]
chan puts stderr WAITING
chan event stdin readable bye
- chan puts OK
+ puts "OK $port"
vwait forever
}
# wait for OK from server.
- chan gets $pipe
+ lassign [chan gets $pipe] ok port
# Now the two clients.
proc done {sock} {
if {[chan eof $sock]} { chan close $sock ; return }
lappend ::forever [chan gets $sock]
return
}
- set a [socket 127.0.0.1 9999]
- set b [socket 127.0.0.1 9999]
+ set a [socket 127.0.0.1 $port]
+ set b [socket 127.0.0.1 $port]
chan configure $a -translation binary -buffering none
chan configure $b -translation binary -buffering none
chan event $a readable [namespace code "done $a"]
diff --git a/tests/io.test b/tests/io.test
index 54ccaac..c0191ee 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -8145,22 +8145,23 @@ test io-53.10 {Bug 1350564, multi-directional fcopy} -setup {
}
puts stderr SRV
set l {}
- set srv [socket -server new 9999]
+ set srv [socket -server new -myaddr 127.0.0.1 0]
+ set port [lindex [fconfigure $srv -sockname] 2]
puts stderr WAITING
fileevent stdin readable bye
- puts OK
+ puts "OK $port"
vwait forever
}
# wait for OK from server.
- gets $pipe
+ lassign [gets $pipe] ok port
# Now the two clients.
proc ::done {sock} {
if {[eof $sock]} { close $sock ; return }
lappend ::forever [gets $sock]
return
}
- set a [socket 127.0.0.1 9999]
- set b [socket 127.0.0.1 9999]
+ set a [socket 127.0.0.1 $port]
+ set b [socket 127.0.0.1 $port]
fconfigure $a -translation binary -buffering none
fconfigure $b -translation binary -buffering none
fileevent $a readable [list ::done $a]