diff options
Diffstat (limited to 'tests/socket.test')
-rw-r--r-- | tests/socket.test | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/socket.test b/tests/socket.test index 30a3746..67e6d46 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -59,7 +59,7 @@ # listening at port 2048. If all fails, a message is printed and the tests # using the remote server are not performed. # -# SCCS: @(#) socket.test 1.86 98/01/02 17:33:48 +# RCS: @(#) $Id: socket.test,v 1.1.2.2 1998/09/24 23:59:36 stanton Exp $ if {[string compare test [info procs test]] == 1} then {source defs} @@ -534,6 +534,34 @@ test socket-2.10 {close on accept, accepted socket lives} { after cancel $timer set done } 1 +test socket-2.11 {detecting new data} { + proc accept {s a p} { + global sock + set sock $s + } + + set s [socket -server accept 2400] + set sock "" + set s2 [socket localhost 2400] + vwait sock + puts $s2 one + flush $s2 + after 500 + fconfigure $sock -blocking 0 + set result [gets $sock] + lappend result [gets $sock] + fconfigure $sock -blocking 1 + puts $s2 two + flush $s2 + fconfigure $sock -blocking 0 + lappend result [gets $sock] + fconfigure $sock -blocking 1 + close $s2 + close $s + close $sock + set result +} {one {} two} + test socket-3.1 {socket conflict} {stdio} { removeFile script |