Lines Matching +refs:close +refs:socket

4 needs cmd socket
7 catch {[socket -ipv6 stream {[::1]:5000}]} res
12 # Also, if we can't bind an IPv6 socket, don't run IPv6 tests
14 [socket -ipv6 stream.server {[::1]:5000}] close
21 # Given an IPv4 or IPv6 server socket, return an address
22 # that a client can use to connect to the socket.
25 proc socket-connect-addr {s} {
36 test socket-1.1 {stream} -body {
38 set s [socket stream.server 127.0.0.1:0]
42 set c [socket stream [$s sockname]]
43 $s close
45 $c close
50 $cs close
51 $s close
55 test socket-1.2 {dgram - connected} -body {
57 set s [socket dgram.server 127.0.0.1:0]
58 set c [socket dgram [$s sockname]]
63 $c close
64 $s close
68 test socket-1.3 {dgram - unconnected} -body {
70 set s [socket dgram.server 127.0.0.1:0]
71 set c [socket dgram]
76 $c close
77 $s close
81 test socket-1.4 {unix} -body {
84 set s [socket unix.server $path]
88 set c [socket unix [$s sockname]]
89 $s close
91 $c close
96 $cs close
97 $s close
101 test socket-1.5 {unix.dgram} -body {
104 set s [socket unix.dgram.server $path]
105 set c [socket unix.dgram [$s sockname]]
110 $s close
111 $c close
115 test socket-1.6 {pipe} -body {
116 lassign [socket pipe] r w
119 $r close
121 $w close
124 $w close
126 $r close
130 test socket-1.7 {socketpair} -body {
131 lassign [socket pair] s1 s2
134 $s1 close
138 $s2 close
141 $s2 close
144 $s1 close
148 test socket-1.8 {stream - ipv6} -constraints ipv6 -body {
150 set s [socket -ipv6 stream.server {[::1]:0}]
154 set c [socket -ipv6 stream [$s sockname]]
155 $s close
157 $c close
162 $cs close
163 $s close
167 test socket-1.9 {dgram - ipv6 - unconnected} -constraints ipv6 -body {
169 set s [socket -ipv6 dgram.server {[::1]:0}]
170 set c [socket -ipv6 dgram]
175 $c close
176 $s close
180 test socket-1.10 {stream - port only} -body {
181 set s [socket stream.server 0]
185 set c [socket stream [socket-connect-addr $s]]
186 $s close
188 $c close
193 $cs close
194 $s close
198 test socket-1.11 {stream - ipv6 - port only} -constraints ipv6 -body {
200 set s [socket -ipv6 stream.server 0]
204 set c [socket -ipv6 stream [socket-connect-addr $s]]
205 $s close
207 $c close
212 $cs close
213 $s close
217 test socket-2.1 {read 1} -body {
218 lassign [socket pipe] r w
220 $w close
229 $r close
233 test socket-2.2 {read to EOF} -body {
234 lassign [socket pipe] r w
236 $w close
238 $r close
242 test socket-2.3 {read -nonewline} -body {
243 lassign [socket pipe] r w
245 $w close
247 $r close
251 test socket-2.4 {isatty} -body {
252 lassign [socket pipe] r w
254 $r close
255 $w close
259 test socket-2.5 {peername} -body {
260 set s [socket stream.server 0]
264 set c [socket stream [socket-connect-addr $s]]
265 $s close
267 $c close
281 $cs close
282 $s close
285 test socket-3.1 {listen} {
286 set s [socket stream.server 0]
288 $s close
291 test socket-3.2 {listen usage} -body {
292 set s [socket stream.server 0]
295 $s close
298 test socket-3.3 {listen usage} -body {
299 set s [socket stream.server 0]
302 $s close
305 test socket-3.4 {listen not a socket} -body {
308 } -returnCodes error -match regexp -result {^(Socket operation on non-socket|Not a socket)$} -clean…
309 $f close
312 test socket-4.1 {invalid ipv6 address} -constraints ipv6 -body {
313 socket -ipv6 stream "- invalid - address -"
316 test socket-4.2 {invalid ipv4 address} -body {
317 socket stream {9.9.9.9.9:0}
320 test socket-4.3 {sockname on non-socket} -body {
323 } -returnCodes error -match regexp -result {^(Socket operation on non-socket|Not a socket)$} -clean…
324 $f close
327 test socket-4.4 {peername on non-socket} -body {
330 } -returnCodes error -match regexp -result {^(Socket operation on non-socket|Not a socket)$} -clean…
331 $f close
337 set s [socket stream.server 0]
340 set c [socket stream [socket-connect-addr $s]]
345 $s close
352 $c close
364 $cs close
366 $s close