Commit 02334e0
committed
Refine nonblock receive/write return types per review
Per review feedback:
- `SSLSocket#syswrite_nonblock`:
- Use `string` (= `String | _ToStr`) instead of `_ToS` for the
argument: the C implementation uses `StringValue`, which converts
via `to_str`, so `nil`, `Hash`, etc. are not accepted.
- Remove `nil` from the `exception: false` return: unlike
`sysread_nonblock`, write has no EOF-equivalent path that returns
`nil`; it raises on real errors and only converts wait-state into
`:wait_readable` / `:wait_writable`.
- `BasicSocket#recv_nonblock`, `BasicSocket#recvmsg_nonblock`,
`Socket#recvfrom_nonblock`, `UDPSocket#recvfrom_nonblock`: include
`nil` in both `exception: true` and `exception: false` overloads.
The rdoc states that these methods return `nil` when the underlying
`recvfrom(2)` returns 0 (closed connection or empty datagram),
regardless of `exception:`.1 parent b89c921 commit 02334e0
4 files changed
Lines changed: 10 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9342 | 9342 | | |
9343 | 9343 | | |
9344 | 9344 | | |
9345 | | - | |
9346 | | - | |
| 9345 | + | |
| 9346 | + | |
9347 | 9347 | | |
9348 | 9348 | | |
9349 | 9349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
| 333 | + | |
| 334 | + | |
335 | 335 | | |
336 | 336 | | |
337 | 337 | | |
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | | - | |
| 405 | + | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1365 | 1365 | | |
1366 | 1366 | | |
1367 | 1367 | | |
1368 | | - | |
1369 | | - | |
| 1368 | + | |
| 1369 | + | |
1370 | 1370 | | |
1371 | 1371 | | |
1372 | 1372 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
| 89 | + | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
0 commit comments