aboutsummaryrefslogtreecommitdiff
path: root/src/nng.c
Commit message (Collapse)AuthorAge
* args: Convert nng_opts_parse into a header only library using `nng_args_parse`.Garrett D'Amore2025-01-04
| | | | | | | | The API is identical, except that some names have changed, and this is now a header library in `nng/args.h` - so the core library does not need to carry this code in binaries. Being a header library also means it is not necessary to link against NNG, and it does not include any parts of NNG; it only depends on a standard C99 or C11 environment.
* api: Promote idhash supplemental API to coreGarrett D'Amore2025-01-04
|
* api: rename nng_send_aio and nng_recv_aio to nng_socket_send and nng_socket_recvGarrett D'Amore2025-01-04
| | | | This aligns more closely with the nng_ctx functions.
* api: drop the 64-bit option accessors (no more 64-bit option types)Garrett D'Amore2025-01-03
|
* ipc: minor adjustments for ECLOSED and loggingGarrett D'Amore2025-01-03
|
* api: remove unused _uint64 options accessors for contexts and socketsGarrett D'Amore2025-01-01
| | | | Also, clarification and add socket option docs for MAXRECVSZ, RECONNMINT, RECONNMAXT
* api: Remove the NNG_FLAG_ALLOCGarrett D'Amore2025-01-01
| | | | | | | | This flag failed to provide real zero copy that it was intended for, and it also involved extra allocations. Further, the API for it was brittle and error prone. Modern code should just work directly with nng_msg structures.
* socket: rename nng_close to nng_socket_closeGarrett D'Amore2024-12-31
|
* aio: nng_aio_defer replaced by nng_aio_startGarrett D'Amore2024-12-26
| | | | | This represents an API change, and we remove the nng_aio_begin function as well, introducing the lightweight nng_aio_reset instead.
* 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.
* aio: introduce nni_aio_deferGarrett D'Amore2024-12-22
| | | | | | | | This will replace nni_aio_schedule, and it includes finishing the task if needed. It does so without dropping the lock and so is more efficient and race free. This includes some conversion of some subsystems to it.
* ctx: Simplify handling for closed contexts.Garrett D'Amore2024-12-07
| | | | | | Once a context has started the process of close, further attempts to close it will return NNG_ECLOSED. What was I thinking to ever do anything else?
* Remove all the get_ptr option accessors.Garrett D'Amore2024-11-24
| | | | | Temporarily we have removed access to the peer alt names, but that was never used and was not tested (it also didn't work with WolfSSL.)
* Remove all the set_ptr option functions.Garrett D'Amore2024-11-24
| | | | | This hopefully ensures that we have good typed functions instead of just passing around pointers blithely.
* Remove the NNG_OPT_IPC_SECURITY_DESCRIPTOR option.Garrett D'Amore2024-11-24
| | | | | | | | This is now replaced with nng_listener_set_security_descriptor and nng_stream_listener_set_security_descriptor functions. We may elect to remove these entirely, but for named pipe users they are probably still quite useful. Moving towards UNIX domain sockets would obsolete this functionality.
* Remove string option functions from sockets and contexts.Garrett D'Amore2024-11-24
| | | | | These are not needed anymore, and the semantics of string accessors is brittle, so we want to eliminate these as much as possible.
* socket: remove unused nng_socket_get_ptr and nng_socket_set_ptr.Garrett D'Amore2024-11-24
| | | | | | | | We will be removing these pointer based functions more generally as we we have type-specific accessors instead. We also removed the context versions of these functions, which were not previously documented.
* listener: add listener_create_url and listen_urlGarrett D'Amore2024-11-23
|
* dialers: add nng_dial_url and nng_dialer_create_urlGarrett D'Amore2024-11-23
| | | | | This allows a URL object to be used for dialing, which may be easier than using a string if you already have the URL object.
* Introduce nng_listener_get_url and nng_dialer_get_url.Garrett D'Amore2024-11-21
| | | | This is intended to replace NNG_OPT_URL.
* Merge internal and external URL APIs. No need forGarrett D'Amore2024-11-18
| | | | the separation of nni_url and nng_url.
* More url work. Undocument rawurl, and stop using it stats and logs.Garrett D'Amore2024-11-17
| | | | | | | Also expose nng_url_sprintf() for users who need it. This avoids some need to do dynamic memory on some things. Soon the entirety of nng_url will be allocation free in the usual case.
* refactor initialization/finalizationGarrett D'Amore2024-11-11
| | | | | | | | | Applications must now call nng_init(), but they can supply a set of parameters optionally. The code is now safe for multiple libraries to do this concurrently, meaning nng_fini no longer can race against another instance starting up. The nni_init checks on all public APIs are removed now.
* TLS configuration changed to use discret _set_tls and _get_tls functions.Garrett D'Amore2024-11-09
| | | | This is simpler, and more reliable than using socket options.
* Remove untyped nng_socket_get and nng_socket_set.Garrett D'Amore2024-11-03
|
* Remove untyped nng_dialer_get/set and nng_listener_get/set.Garrett D'Amore2024-11-03
|
* Remove nng_ctx untyped option functionsGarrett D'Amore2024-11-03
|
* Remove untyped nng_pipe_get, support for untyped sockaddr set.Garrett D'Amore2024-11-03
| | | | This is a step on the path to removing unsafe untyped option accesses.
* Replace `NNG_OPT_RAW` with `nng_socket_raw`.Garrett D'Amore2024-11-02
| | | | Similar to the other identities, this simplifies code a bit.
* Replace `NNG_OPT_PROTO`, `NNG_OPT_PROTONAME`, and friends with functions.Garrett D'Amore2024-11-02
| | | | | | Socket options were a little awkward, and these are core properties of the socket. Few if any applications need these. This also avoids some dynamic allocations.
* Remove nng_ctx/socket_set/get_addrGarrett D'Amore2024-11-02
| | | | | Support for setting or getting sockaddrs on sockets or on contexts makes little sense, since these are always transport specific.
* NNG_OPT_RECVFD and NNG_OPT_SENDFD converted to functions.Garrett D'Amore2024-11-02
| | | | | | | | | | These options are removed entirely, and their functionality is now available via special functions, `nng_socket_get_send_poll_fd` and `nng_socket_get_recv_poll_fd`, making these first class methods on the socket. This eliminates a bit of wasteful code, and provides type safety for these methods.
* UDP: Introduce an experimental (undocumented for now) public API for UDP. ↵Garrett D'Amore2024-06-02
| | | | | | | | (#1838) This exposes the UDP methods as nng_ methods, and adds support for Multicast Membership, which is useful in a variety of situations. No documentation is provided, and applications should consider thios API experimental.
* Move the rest of the functionality from platform.h into core.Garrett D'Amore2024-04-23
| | | | This also deprecates supplemental/util/platform.h.
* fixes #1572 nng creates too many threadsGarrett D'Amore2024-01-01
| | | | | | | | | | | | This further limits some of the thread counts, but principally it offers a new runtime facility, nng_init_set_parameter(), which can be used to set certain runtime parameters on the number of threads, provided it is called before the rest of application start up. This facility is quite intentionally "undocumented", at least for now, as we want to limit our commitment to it. Still this should be helpful for applications that need to reduce the number of threads that are created.
* fixes #1751 Support nng_aio_set_expire().Garrett D'Amore2023-12-30
| | | | While here fixed a number of nits in comments.
* fixes #1574 Non-blocking version of nng_aio_wait / nng_aio_resultGarrett D'Amore2022-04-18
| | | | | | | This introduces a new API, nng_aio_busy(), that can be used to query the status of the aio without blocking. Some minor documentation fixes are included.
* Introduce nng_device_aio().Garrett D'Amore2021-12-27
| | | | | | This function is like nng_device(), but runs asynchronously. Also, this fixes #1503 nng_device causes nng_close to blocking
* Fix incorrect elides of deprecated code.Garrett D'Amore2021-11-29
| | | | | | (Note that this includes some incorrect formatting due to an apparent bug in clang-format 13. Hopefully they'll fix it later, but for now I'm preserving the bad whitespace.)
* fixes #1536 nng_sendmsg and nng_recvmsg could be fasterGarrett D'Amore2021-11-28
| | | | fixes #1535 Desire nng_ctx_sendmsg and nng_ctx_recvmsg
* fixes #1498 Endpoint close/shutdown could be synchronous (#1499)Garrett D'Amore2021-09-04
|
* Add & document msg_capacity, msg_reserve (#1458)Evan Balster2021-07-06
| | | | | | | * Add & document msg_capacity, msg_reserve * reserve/capacity code style * Documentation references to reserve/capacity
* fixes #1313 support deferred nng_aio destructionGarrett D'Amore2020-12-12
|
* fixes #1365 nng_recvmsg returns NNG_ETIMEDOUT rather than NNG_EAGAINGarrett D'Amore2020-12-05
|
* fixes #1071 tran_chkopt can be cleaned upGarrett D'Amore2020-11-15
| | | | | | | | | | | | | | | | | This is a sweeping cleanup of the transport logic around options, and also harmonizes the names used when setting or getting options. Additionally, legacy methods are now moved into a separate file and can be elided via CMake or a preprocessor define. Fundamentally, the ability to set to transport options via the socket is deprecated; there are numerous problems with this and my earlier approaches to deal with this have been somewhat misguided. Further these approaches will not work with future protocol work that is planned (were some options need to be negotiated with peers at the time of connection establishment.) Documentation has been updated to reflect this. The test suites still make rather broad use of the older APIs, and will be converted later.
* fixes #1171 message header could be inlined in the message structureGarrett D'Amore2020-02-26
| | | | | This uses a maximum 64-byte header and should avoid allocations and cache misses, leading to a small performance boost overall.
* fixes #1201 Unexpected error return code: NNG_ENOMEMGarrett D'Amore2020-02-25
|
* fixes #1145 nng_msg options should be removedGarrett D'Amore2020-01-19
|
* RESPOND needs to use atomic for TTL.Garrett D'Amore2020-01-16
| | | | | Also, add a test to cover the RESPOND protocol. This gets about 95% of the coverage.
* fixes #1094 Consider in-lining task and aioGarrett D'Amore2020-01-08
| | | | | This only does it for rep, but it also has changes that should increase the overall test coverage for the REP protocol