aboutsummaryrefslogtreecommitdiff
path: root/src/sp/transport/udp/udp.c
Commit message (Collapse)AuthorAge
* Replace nng_pipe_get_addr, nng_stream_get_addr, and the NNG_OPT_REMADDR option.Garrett D'Amore2025-10-27
| | | | | | | | | | | More direct access methods are provided instead. This results in much lower friction when using, and is a step on the path to removing NNG_OPT_LOCADDR as well. We need to figure a solution for NNG_OPT_LOCADDR for dialers; for listeners there is little use in it either, and it will be removed. (Dialers will probably get a new NNG_OPT_BIND_IP option.)
* NNG_OPT_BOUND_PORT replaces NNG_OPT_TCP/UDP_BOUND_PORT.Garrett D'Amore2025-10-26
| | | | | | | | | | This is easier and agnostic about the underlying L3 protocol. We plan to remove direct NNG_OPT_LOCADDR support from listeners (and probably both NNG_OPT_LOCADDR and NNG_OPT_REMADDR have numbered days left in their lifetime. They will be replaced with more direct typed access functions as has been done for pipes already.) While here fixed some include for IWYU in the POSIX platform.
* Plumb sockaddrs all the way through pipes, make them failsafe.Garrett D'Amore2025-10-25
| | | | These functions can no longer fail.
* header file fixesGarrett D'Amore2025-10-09
|
* UDP: Signficant refactoring and simplification.Garrett D'Amore2025-06-08
| | | | | | | | | | | | | | This work is inspired by the DTLS work, and harmonizes the UDP implementation with DTLS somewhat. This should make it more resilient to failures, although there is no longer any attempt to guard against sequencing (reorders, dupes) errors. Applications that need such protection should either add it themselves, or use a transport which provides that guarantee (such as TCP). Note that with devices and and such in the way, such guarantees have never been perfect with SP anyway. The UDP transport header sizes for this are now just 8 bytes (beyond the UDP header itself.
* UDP: constify sockaddrs in some placesGarrett D'Amore2025-06-07
|
* Fix typos across docs, comments, and CMakemochalins2025-06-02
|
* Introduce DTLS transport for NNG.Garrett D'Amore2025-06-01
| | | | | | | | | | | | | This introduces a new experimental transport for DTLS, that provides encryption over UDP. It has a simpler protocol than the current UDP SP protocol (but we intend to fix that by making the UDP transport simpler in a follow up!) There are a few other fixes in the TLS layer itself, and in the build, that were needed to accomplish this work. Also there was an endianness bug in the UDP protocol handling, which is fixed here.
* Converted rest of transports to nng_err.Garrett D'Amore2025-04-27
|
* Converted property functions to use nng_err.Garrett D'Amore2025-04-27
|
* Transport listen: use nng_errGarrett D'Amore2025-04-27
|
* AIO: Use nng_err for cancellation callback instead of int.Garrett D'Amore2025-04-27
| | | | | | This is part of our work to improve type safety/awareness, and also improve debugger support, for NNG error codes. There are still quite a few more but this should help.
* api: pipes should use nng_errGarrett D'Amore2025-01-14
|
* udp: use a bounce buffer if we lack sendmsg or recvmsgGarrett D'Amore2024-12-29
| | | | | This includes checks to determine if those functions are present, and a test case to verify that scatter gather with UDP works.
* resolver: use explicit resolver item provided by callerGarrett D'Amore2024-12-28
| | | | | | This avoids the need to perform multiple allocations for dialing, eliminating additional potential failures. Cancellation is also made simpler and more perfectly robust.
* udp: more nni_aio_startGarrett D'Amore2024-12-26
|
* udp: use nni_aio_startGarrett D'Amore2024-12-26
| | | | | | This also moves the close of the UDP socket later, to avoid a potential use after free while the aio's are still in-flight. Unfortunately we cannot unbind cleanly without a hard close.
* aio: introduce NNG_ESTOPPEDGarrett D'Amore2024-12-26
| | | | | | | | | | | This error code results when an AIO is stopped permanently, as a result of nni_aio_close or nni_aio_stop. The associated AIO object cannot be used again. This discrimantes against a file being closed, or a temporary cancellation which might allow the aio to be reused. Consumers must check for this error status in their callbacks, and not resubmit an operation that failed with this error. Doing so, will result in an infinite loop of submit / errors.
* transports: all transports use the new inline approachGarrett D'Amore2024-12-15
| | | | | | We can retire the old approach that used separate allocations, and all of the supporting code. This also gives us a more natural signature for the end point initializations.
* udp: implement endpoint stop functionsGarrett D'Amore2024-12-11
|
* udp transport: convert to using inline pipes and endpointsGarrett D'Amore2024-12-08
| | | | | This allows us to eliminate some extra reference counting and reaping related complexity.
* udp: hang on close after sending too largeGarrett D'Amore2024-12-07
|
* udp: remove NNG_OPT_URLGarrett D'Amore2024-11-23
|
* Collect the bound port as part of the URL at bind time.Garrett D'Amore2024-11-21
| | | | This is a step on cleaning up our logic around NNG_OPT_URL.
* URL u_port should be a number not a string.Garrett D'Amore2024-11-17
| | | | | | | | | | | The idea here is to reduce the dynamic allocations used for URLs, and also the back and forth with parsing begin strings and port numbers. We always resolve to a port number, and this is easier for everyone. The real goal in the long term is to eliminate dynamic allocation of the URL fields altogether, but that requires a little more work. This is a step in the right direction.
* UDP: prefer new packets (drop older)Garrett D'Amore2024-11-04
| | | | Adds test cases for this and for remote pipe as well.
* fixes #1890 stats could support an inline lock - remove most atomicsGarrett D'Amore2024-10-13
| | | | | This starts by updating UDP to use this approach, since we already have a convenient lock. We should look at doing the same for other stats.
* stats: Reduce some wasted space for disabled stats.Garrett D'Amore2024-10-13
| | | | | Unfortunately for now we have the struct itsel,f but it can become mostly empty.
* udp: fix race, fix testsGarrett D'Amore2024-10-13
|
* UDP: burst testing to improve coverageGarrett D'Amore2024-10-13
| | | | | We are finding that on darwin its very easy for us to lose UDP messages as the socket buffer appears to be depressingly small.
* UDP: numerous fixes, added test for copy breakGarrett D'Amore2024-10-13
| | | | | | There were several bugs here, including use-after-free, a problem when the copy limit was exceeded, and uninitialized receive thresholds.
* UDP: add some statisticsGarrett D'Amore2024-10-12
|
* udp: fix leaks on EP destroyGarrett D'Amore2024-10-07
|
* fixes #168 UDP transportGarrett D'Amore2024-10-05
This is the initial implementation of UDP transport. It does in order guarantees (and consequently filters duplicates), but it does not guarantee delivery. The protocol limits payloads to 65000 bytes (minus headers for SP), but you really want to keep it to much less -- probably best for short messages that within a single MTU to avoid IP fragmentation and reassembly. This is unicast only for now (although there are plans for some support for multicast and broadcast as well as being able to perform automatic mesh building, but that will be in following work. Additional tunables are coming. This is only lightly tested at this point, and should be considered experimental. Its also undocumented.