| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
The ops vector / protocol API/ABI were meant to support external
implementations, but we have moved away from having pluggable protocols,
and we aren't likely to support it any time soon.
|
| |
|
|
|
|
|
|
| |
This is going to be used to facilitate debugging, and eliminate some
inconveniences around these things. We plan to move the pipe functions
to use these directly, hopefully moving away from the pipe_getopt hack.
(The transport API will need to grow these. For now this is just the
streams.)
|
| | |
|
| |
|
|
|
|
| |
Also, some instances nni_aio are changed to nng_aio. We think we want to harmonize
some of these types going forward as it will reduce the need to include headers
hopefully letting us get away with just "defs.h" in more places.
|
| |
|
|
|
| |
This simplifies the code to just use a precompiled static list.
This should be lighter weight, and provably free from leaks.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a new transport API, which should make it easier for transports
to rely upon lifetime guarantees made by the common SP framework, thus
eliminating the need for transport specific reference counters, reap
lists, and similar.
The transport declares the size of the object in the ops vector (for
pipe, dialer, or listener), and the framework supplies one allocated
using the associated allocator.
For now these add the pipe object to the socket and endpoint using
linked linked lists. The plan is to transition those to reference
counts which should be lighter weight and free form locking issues.
The pipe teardown has been moved more fully to the reaper, to avoid
some of the deadlocks that can occur as nni_pipe_close can be called
from almost any context.
For now the old API is retained as well, but the intention is to convert
all the transports and then remove it.
|
| |
|
|
|
|
| |
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?
|
| |
|
|
|
|
|
|
| |
This functionality was provided principally for libnanomsg compatibility.
This saves some memory and eliminates some pointless functionality.
While here, updated the socket options documentation to remove references
to options already removed.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
The framework for saving and replaying socket options was left
over, and should not be used. But we do need to send the initial
socket options to endpoints when creating them, so we have support
for that in a cleaner fashion that does not require memory allocations.
|
| |
|
|
|
|
|
|
| |
This also fixes a couple of minor bugs -- changing the socket name
could be incorrect as the termination was not applied properly,
and the ZeroTier code got a change -- note that it is only possible
in this revised version to pass a single moon ID for ZT orbit.
The ZT code is a bit stale, and untested anyway.
|
| | |
|
| |
|
|
|
| |
The main purpose is to eliminate the NNI_TYPE_OPAQUE options,
by putting these into their own first class, protocol-specific, functions.
|
| |
|
|
| |
Similar to the other identities, this simplifies code a bit.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
We try to move the msgq close up earler. While here we can stop
dropping and reacquiring the lock -- this is likely left over
and may lead to races.
|
| |
|
| |
The socket member `st_name` is not available when NNG_ENABLE_STATS is OFF.
|
| |
|
|
|
| |
Also this fixes problems with uninitialized socket names, and the
socket name stat not being adjusted correctly when set via API.
|
| |
|
|
|
|
| |
This function is like nng_device(), but runs asynchronously.
Also, this fixes #1503 nng_device causes nng_close to blocking
|
| |
|
|
|
| |
This makes these functions entirely bullet proof, and eliminates
yet more error handling cases.
|
| |
|
|
| |
This also arranges to clean up the maps at nng_fini time.
|
| |
|
|
|
|
| |
This eliminates some run-time initialization, moving it to compile time.
Additional follow up work will expand on this to simplify initialization
and reduce the need for certain locks.
|
| |
|
|
|
|
| |
(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.)
|
| |
|
|
|
|
|
|
|
|
| |
This eliminates several mutex operations done each time a pipe
is created or destroyed. For large scale systems this should
reduce overall pressure on the memory subsystem, and scale better
as many threads are coming and going.
This also reduces the overall size of nni_pipe -- on Linux by
36 bytes typically.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
* fixes #1456 bad access in OSX thread on nn
* Fix broken aio in darwin cloud.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
Co-authored-by: Jaylin <oblivionangel@sina.com>
|
| |
|
|
|
|
| |
This should reduce the amount of copying, and the overall size
used by pipes and other objects quite a bit. (On my system, the
sizeof nni_pipe shrank by 400 bytes, for example.)
|