| Commit message (Collapse) | Author | Age |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This includes checks to determine if those functions are present,
and a test case to verify that scatter gather with UDP works.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Nearly all applications are either purely server based (needing no
resolvers really), or dialers only dialing a single destination.
These do not need multiple dialers, and threads are expensive on some
platforms (and they are more trouble during debugging.)
|
| |
|
|
|
|
| |
This avoids the need to perform multiple allocations for dialing,
eliminating additional potential failures. Cancellation is also
made simpler and more perfectly robust.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
The endpoints both use a nesting level for some common code and some
platform dependent code. But the common code isn't that much and we
have similar patterns for e.g. IPC.
This avoids a layer of indirection in the structs, and extra allocations.
The payoff will be even larger for the dialers, but that is next.
(Dialers are more complicated because of DNS.)
|
| |
|
|
|
|
|
|
|
|
| |
All vestiges of ZeroTier have been removed. Also, as consequence,
some binary values have changed (specifically the number of the
address family used for NNG_AF_ABSTRACT.)
We may create a new ZeroTier transport that makes use of lwIP to
provide for ZeroTier and native host network coexistence, without
requiring ZeroTier to participate in the native networking stack.
|
| | |
|
| | |
|
| |
|
|
|
| |
The nni_aio_start function replaces these two functions with a
simple, single call, reducing pressure on common locks.
|
| |
|
|
|
| |
This represents an API change, and we remove the nng_aio_begin
function as well, introducing the lightweight nng_aio_reset instead.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This allows some use cases to reset things like the counts and outputs, before
submitting more jobs. Providers should call this near the top of their
functions; this is done without any locks so it should be very fast.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Also make nni_aio_sleep use it.
|
| |
|
|
|
| |
This should help some cases of synchronous callers that don't use
a callback at all.
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
This is done for kqueue and poll. Others coming soon.
|
| |
|
|
|
|
|
| |
The missing default of zero leads to a hard spin and exhaustion of
the open files (since reaping can take too long).
The workaround is to configure these explicitly.
|
| |
|
|
|
|
| |
Some POSIX emulations may lack a reasonable syslog function
(although syslog is required per the Open Group). For now we
just check for it, and don't use it if it isn't present.
|
| |
|
|
|
|
| |
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 follows a pattern we started earlier with IPC.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This allows us to explicitly stop streams, dialers, and listeners,
before we start tearing down things. This hopefully will be useful
in resolving use-after-free bugs in http, tls, and websockets.
The new functions are not yet documented, but they are
nng_stream_stop, nng_stream_dialer_stop, and nng_stream_listener_stop.
They should be called after close, and before free. The close
functions now close without blocking, but the stop function is
allowed to block.
|
| |
|
|
|
| |
Add test cases ensuring that the transports implement all
required functionality (entry points are not null).
|
| |
|
|
|
|
| |
This should allow us to stop the endpoints early, without freeing
them. This ensures that pipe creation has ended before we start
tearing down pipes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
The use of task_abort to prematurely fail an aio at scheduling
time was a mistake, because it could have led to duplicate calls
to nng_aio_finish(). We do need to ensure that we leave an indicator
so that nni_aio_schedule can return the abort status to caller,
in the case that abort is called between the nni_aio_begin and
nni_aio_schedule calls.
|
| |
|
|
|
|
| |
The aio structures need to be finalized, and the sockets should
be held until the device is totally finalized to prevent any
possible use after free.
|
| | |
|
| |
|
|
|
|
| |
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?
|
| |
|
|
|
|
|
|
| |
Operations that might be performed during teardown, such as reaping,
waiting, closing, freeing, should only be done if the aio has properly
been initialized. This is important for certain simple cases where
inline aio objects are used, and initialization of an outer object can
fail before the enclosed aio is initialized.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Make sure *everything* is drained before proceeding all the way
to deallocation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Probably other subsystems should get the same treatment. We need
to basically start the process of shutting down so that subsystems
know to cease operation before we rip memory out from underneath them.
This ensures that no new operations can be started as well, once we
have begun the process of teardown.
We also enhanced the completion of sleep to avoid some extra locking
contention, since the expiration *is* the completion.
Includes a test for this case.
|
| |
|
|
|
| |
We do not want to let operations restart if we're in the process of shutting
down. This ensures that they get a reasonable hard failure.
|
| |
|
|
|
|
|
|
|
|
| |
This starts by using this for the nni_pipe, but we will use it
for the other primary objects as well. This should simplify
the tear down and hopefully eliminate some races.
It does mean that pipe destruction goes through an additional
context switch, for now at least. This shouldn't be on the hot
data path anyway.
|