| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
| |
This introduces a new option "NNG_OPT_LISTEN_FD", understood by TCP, TLS,
and (on POSIX systems) IPC. This option is used to pass a file descriptor
or handle (Windows) that is already listening (ready for ACCEPT to be called).
For TCP and TLS, the socket must be of type AF_INET or AF_INET6, and for IPC
it must be of type AF_UNIX.
|
| |
|
|
|
|
| |
While here, remove some code paths that do not occur by definition.
(For example, if the resolver succeeds, we will definitely have a
valid set of addresses, but if it fails, we will definitely not.)
|
| |
|
|
|
|
| |
This avoids the need to perform multiple allocations for dialing,
eliminating additional potential failures. Cancellation is also
made simpler and more perfectly robust.
|
| | |
|
| | |
|
| |
|
|
|
|
| |
This avoids the need for a lock during listener or dialer initialization,
and it avoids the need to carry these pointers on those objects.
It also eliminates a potential failure case "post startup".
|
| |
|
|
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
This is done for kqueue and poll. Others coming soon.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
This refactors a lot of the IPC code to hopefully address various
hangs on shutdown, etc. The problem is that named pipes are not
terrifically reliable when it comes to aborting ConnectNamedPipe.
Additionally there were some logic errors in some of our code that
left things rather brittle.
Ultimately this all needs to be replaced with UNIX domain sockets
which are superior in many ways.
|
| | |
|
| |
|
|
|
| |
Make sure *everything* is drained before proceeding all the way
to deallocation.
|
| |
|
|
|
| |
This hopefully addresses a long standing bug with Windows IPC sometimes
hanging on shut down.
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
While TCP and UDP port numbers are 16-bits, ZT uses a larger (24-bit)
port number.
|
| |
|
|
|
|
|
| |
This eliminates most (but not all) of the dynamic allocations
associated with URL objects. A number of convenience fields
on the URL are removed, but we are able to use common buffer
for most of the details.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
This is a step on the path to removing unsafe untyped option accesses.
|
| |
|
|
| |
This was not really used or useful.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
| |
This fixes a problem only found on Windows, that affected both IPC and TCP.
|
| |
|
|
|
|
|
|
| |
(#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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
The logic with overlapped structures was fragile as it used
overlapped ios for the connections rather than a single common
one for the listener. This changes it to be more like POSIX, and
robust against this error.
|
| |
|
|
| |
We use overlapped I/O, so we don't need a separate hEvent.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
If you want to build on Windows use a toolchain that supports modern APIs.
This means, for Microsoft, UCRT (Universal C Runtime), which is supported
by default on modern Visual Studio. MinGW users may have to go out of their
way to enable it. (New -D_UCRT flag or something.)
The supported toolchain for building on Windows is Visual Studio. Use of
other tool chains is not officially supported or guaranteed to work. YMMV.
|
| |
|
|
|
| |
The realtime clock is not (yet) exposed for user applications, but it
is used for logging timestamps accurately.
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This looks like a possible problem that may be windows specific involving
the flow for IO completion ports. This simplifies the logic a little bit,
and should ensure that canceled requests on pipes do not restart.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
This (defaults to 8) sets a limit on the number of poller threads
that will be used for servicing I/Os. This is the size of the
I/O completion port thread pool on Windows. POSIX pollers are generally
not concurrent at present.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
fix compile error in nano using clang version 16.0.5
fix issue: https://github.com/nanomsg/nng/issues/1676
|
| |
|
| |
From the Windows docs, this option must receive as parameters the listener socket.
|