| ... | @@ -316,10 +316,10 @@ pub const Listener = struct { | ... | @@ -316,10 +316,10 @@ pub const Listener = struct { |
| 316 | } | 316 | } |
| 317 | }; | 317 | }; |
| 318 | | 318 | |
| 319 | test "tcp: create non-blocking pair" { | 319 | test "tcp: create client/listener pair" { |
| 320 | if (builtin.os.tag == .wasi) return error.SkipZigTest; | 320 | if (builtin.os.tag == .wasi) return error.SkipZigTest; |
| 321 | | 321 | |
| 322 | const listener = try tcp.Listener.init(.ip, os.SOCK_NONBLOCK | os.SOCK_CLOEXEC); | 322 | const listener = try tcp.Listener.init(.ip, os.SOCK_CLOEXEC); |
| 323 | defer listener.deinit(); | 323 | defer listener.deinit(); |
| 324 | | 324 | |
| 325 | try listener.bind(tcp.Address.initIPv4(IPv4.unspecified, 0)); | 325 | try listener.bind(tcp.Address.initIPv4(IPv4.unspecified, 0)); |
| ... | @@ -327,13 +327,12 @@ test "tcp: create non-blocking pair" { | ... | @@ -327,13 +327,12 @@ test "tcp: create non-blocking pair" { |
| 327 | | 327 | |
| 328 | const binded_address = try listener.getLocalAddress(); | 328 | const binded_address = try listener.getLocalAddress(); |
| 329 | | 329 | |
| 330 | const client = try tcp.Client.init(.ip, os.SOCK_NONBLOCK | os.SOCK_CLOEXEC); | 330 | const client = try tcp.Client.init(.ip, os.SOCK_CLOEXEC); |
| 331 | defer client.deinit(); | 331 | defer client.deinit(); |
| 332 | | 332 | |
| 333 | testing.expectError(error.WouldBlock, client.connect(binded_address)); | 333 | try client.connect(binded_address); |
| 334 | try client.getError(); | | |
| 335 | | 334 | |
| 336 | const conn = try listener.accept(os.SOCK_NONBLOCK | os.SOCK_CLOEXEC); | 335 | const conn = try listener.accept(os.SOCK_CLOEXEC); |
| 337 | defer conn.deinit(); | 336 | defer conn.deinit(); |
| 338 | } | 337 | } |
| 339 | | 338 | |