aboutsummaryrefslogtreecommitdiff
path: root/src/core
Commit message (Collapse)AuthorAge
...
* 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.
* 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.
* NNI_GETXX macros are brittle due to casting mistake.Garrett D'Amore2024-11-02
| | | | | Essentially, we forgot to dereference as uint8_t *, which can lead to some suprises if these are misused.
* Remove nng_stream_set function family.Garrett D'Amore2024-10-28
| | | | This was not really used or useful.
* streams: drop some stream set functionsGarrett D'Amore2024-10-28
| | | | | | | | | | | We don't need nng_stream_set_addr nor nng_stream_set_ptr. These methods are simply not useful for streams, which have their properties established at creation time. Arguably in fact, all of nng_stream_set_* could go away -- the only properties it is implemented for are TCP keepalive and nodelay tuning, and those should be reasonably set by the creator of the stream.
* tls: move definitions to core nng.hGarrett D'Amore2024-10-28
| | | | | | TLS is not really merely supplemental anymore. Its pretty fundamental. Let's make it accessible directly. This will allow us to define typed property access functions.
* remove legacy support for configuration of transport options on socketGarrett D'Amore2024-10-20
| | | | | | | | | Transport specific options should be configured on the end point. This has the most impact for TLS, as TLS dialers and listeners will need to be allocated apriori, to configure TLS options. Some legacy tests were removed... we're going to remove the legacy libnanomsg compatibility layer anyway.
* Use `const` for nng_stat when possible.Garrett D'Amore2024-10-20
| | | | | This should help the compiler enforce checks, and may result in better optimizations.
* 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.
* stats: Reduce the need for NNG_ENABLE_STATS checks everywhere.Garrett D'Amore2024-10-13
|
* Fix case for infinite sleep.Garrett D'Amore2024-10-07
| | | | | If one tries to sleep indefinitely, a sign bug leads to constantly waking calls, which causes an infinite cycle in the expire loop.
* Integer sign extension bug in socket.c.Garrett D'Amore2024-10-07
| | | | | | It turns out that for now this results in early wakeups, due to another bug in the aio framework. But when that bug is fixed, this bug will lead to hangs when redialing.
* fix aio test failures on darwinGarrett D'Amore2024-10-06
| | | | | Actually this test appears to be broken everywhere, and the only reason it ever worked is that we took > 50 ms to context switch.
* Actually enable UDP. Also fix some UWYI includes.Garrett D'Amore2024-10-06
|
* msg: add sockaddr to message structureGarrett D'Amore2024-10-05
| | | | | This is expected to be useful for new transports where we need the sock address to properly reply (think UDP with multicast).
* idhash: introduce nni_idhash_count.Garrett D'Amore2024-10-05
| | | | This will be used for some follow up work (UDP).
* Endianness improvements.Garrett D'Amore2024-10-05
| | | | | | | This adds endian awareness at compile time, and defines some little endian versions of some macros. We antiicpate making more use of little endian in new protocols to reduce the "endian tax", as nearly every modern system is little endian these days.
* Introduce nni_url_to_address for common URL to sockaddr support.Garrett D'Amore2024-10-05
| | | | | This will be used in UDP. It also lets us reduce some unnecessary code paths for redundant library initialization.
* log: eliminate redundant newlines sometimes presentGarrett D'Amore2024-08-14
|
* idhash: add nng_id_visit APIGarrett D'Amore2024-08-11
| | | | | | This allows an efficient way to iterate over the entries stored in an ID hash. The iteration is fast, and requires no additional storage. The order of iteration is not guaranteed.
* fixes #1835 setting NNG_OPT_TLS_CONFIG on socket should hold referenceGarrett D'Amore2024-07-21
|
* 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.
* Safer initialization of aiosGarrett D'Amore2024-05-30
|
* fix for pipe statistic crashGarrett D'Amore2024-05-30
|
* fixes #1827 Windows a deadlock on nng_close()Garrett D'Amore2024-05-30
|
* fix deadlock on socket closeAlexander Zilberkant2024-04-24
| | | | when an `aio` has no `a_cancel_fn` and the task is in `task_prep` abort it on `nni_aio_stop` call
* fixes #1808 nng_msg_insert: munmap_chunk(): invalid pointerGarrett D'Amore2024-04-24
| | | | | | | With specific message sizes, we the shuffle of data for msg insert can calculate the wrong value, leading to heap corruption. This includes a stress test for msg insert to hopefully exercise every reasonable edge case.
* Logging improvements (#1816)Garrett D'Amore2024-04-21
| | | | | | | | | | | | * Add nng_str_sockaddr to get string representation of socket address. * Added nng_log_get_level() is meant to allow users to obtain the current level and avoid some possibly expensive operations just to collect debugging information when debugging is not in effect. We use a custom logger for NUTS, and this fits within the NUTS test framework well, so that if -v is supplied we get more content. All tests now get this by default.
* Announce NNG version in log.Garrett D'Amore2024-04-14
|
* Log rejects by app, bind/listen/connect failures.Garrett D'Amore2024-04-14
|
* Added realtime clock support, and better timestamping.Garrett D'Amore2024-04-14
| | | | | The realtime clock is not (yet) exposed for user applications, but it is used for logging timestamps accurately.
* minor include fixGarrett D'Amore2024-04-14
|
* fixes #543 Add logging support frameworkGarrett D'Amore2024-04-13
|
* Update protocol.hBrian Carcich2024-03-16
| | | Fix comment typo
* fixes #1496 Provide NNG_ENABLE_IPV6 option (disabled by default)Garrett D'Amore2024-02-25
| | | | | | | | | This also checks if the build system has the definitions for AF_INET6, which might help in some embedded IPv4 only settings. The resolver test is enhanced to include a check for IPv6 enabled in the kernel. IPv6 support is enabled by default, of course.
* New CMAKE option NNG_ENABLE_COMPAT (defaults ON)Garrett D'Amore2024-01-27
| | | | | | This option allows the compatibility code to be elided from the build. This saves build time, and eliminates bloat from a static library when used strictly in native NNG mode.
* Fix warning from inconsistent socket_pair prototype.Garrett D'Amore2024-01-06
|
* silence compiler warning from minimum int constantGarrett D'Amore2024-01-01
|
* 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.
* Comment typoGarrett D'Amore2024-01-01
|
* fixes #1751 Support nng_aio_set_expire().Garrett D'Amore2023-12-30
| | | | While here fixed a number of nits in comments.
* fixes #1740 Public ID hash APIGarrett D'Amore2023-12-29
| | | | | | | | | This includes a manual page documenting the entire set of functions in one step. The hash is 64-bit based for now, to be maximally flexible. An internal 32-bit convenience for the common internal use is also provided (not public). The public API includes a test suite.
* fixes #1746 Create a new socket:// transport for socketpair() based connectionsGarrett D'Amore2023-12-29
| | | | | | | | | | | | | This transport only listens, and creates connections when the application calls setopt on the lister with NNG_OPT_SOCKET_FD, to pass a file descriptor. The FD is turned into an nng_stream, and utilized for SP. The protocol over the descriptor is identical to the TCP protocol (not the IPC protocol). The options for peer information are borrowed from the IPC transport, as they may be useful for these purposes. This includes a test suite and full documentation.
* fixes #1729 remove nni_timerGarrett D'Amore2023-12-17
|
* fixes #1728 surveyor could be simplified to not use timerGarrett D'Amore2023-12-17
|
* fixes #1523 rare SEGV in sub nni_list_removeGarrett D'Amore2023-11-25
| | | | | | | | | | | | Credit goes to Wu Xuan (@willwu1217) for diagnosing and proposing a fix as part of #1695. This approach takes a revised approach to avoid adding extra memory, and it also is slightly faster as we do not need to update both pointers in the linked list, by reusing the reap node. As part of this a new internal API, nni_aio_completions, is introduced. In all likelihood we will be able to use this to solve some similar crashes in other areas of the code.
* fix: use ifdef for NNG_HAVE_BACKTRACEMarco Casaroli2023-11-25
| | | | | | | In some places, we use ifdef, and others if. This normalizes for always using ifdef, so we can compile when this macro is not defined.
* fix: use ifdef for NNG_ENABLE_STATSMarco Casaroli2023-11-25
| | | | | | | In some places, we use ifdef, and others if. This normalizes for always using ifdef, so we can compile when this macro is not defined.
* fixes #1619 expose expire threads tunablesPaulo Henrique Silva2023-08-27
| | | | | | | | | | | | | | | | | | This change makes expire threads tunable follows the same strategy as taskq threads tunables. Add NNG_NUM_EXPIRE_THREADS to override the default behavior (`n_cpu` expire threads). The NNG_MAX_EXPIRE_THREADS limit is always applied if > 0, even if you specify the desired number of threads using NNG_NUM_EXPIRE_THREADS. NNG_EXPIRE_THREADS is not used anymore. This was only referenced in the code but never defined on CMake. The logic to cap expire threads between 1 and 256 was removed. If users set no limits, whatever value they choose will be used instead of being silently overridden by us.