diff options
| author | Patiga <dev@patiga.eu> | 2022-12-03 12:44:32 +0100 |
|---|---|---|
| committer | Patiga <dev@patiga.eu> | 2023-08-22 18:19:49 +0200 |
| commit | adb22b92dd3674cf9b661504575b53245eec7f65 (patch) | |
| tree | bbeb93342df4e0ade5e4d87775cdcd83aa8f06b0 /tests/rustdoc-js-std/path-ordering.js | |
| parent | 320b412f9c55bf480d26276ff0ab480e4ecb29c0 (diff) | |
| download | rust-adb22b92dd3674cf9b661504575b53245eec7f65.tar.gz rust-adb22b92dd3674cf9b661504575b53245eec7f65.zip | |
Improve UdpSocket documentation
I tried working with `UdpSocket` and ran into `EINVAL` errors with no clear indication of what causes the error. Also, it was uncharacteristically hard to figure this module out, compared to other Rust `std` modules. 1. `send` and `send_to` return a `usize` This one is just clarity. Usually, returned `usize`s indicate that the buffer might have only been sent partially. This is not the case with UDP. Since that `usize` must always be `buffer.len()`, I have documented that. 2. `bind` limits `connect` and `send_to` When you bind to a limited address space like localhost, you can only `connect` to addresses in that same address space. Error kind: `AddrNotAvailable`. 3. `connect`ing to localhost locks you to localhost On Linux, if you first `connect` to localhost, subsequent `connect`s to non-localhost addresses fail. Error kind: `InvalidInput`. Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
Diffstat (limited to 'tests/rustdoc-js-std/path-ordering.js')
0 files changed, 0 insertions, 0 deletions
