aboutsummaryrefslogtreecommitdiff
path: root/src/platform
Commit message (Collapse)AuthorAge
...
* tcp: flatten the listener implementationGarrett D'Amore2024-12-28
| | | | | | | | | | 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.)
* udp: use nni_aio_startGarrett D'Amore2024-12-26
| | | | | | 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.
* ipc: use nni_aio_startGarrett D'Amore2024-12-26
|
* resolver: use nni_aio_startGarrett D'Amore2024-12-26
|
* tcp: use nni_aio_startGarrett D'Amore2024-12-26
|
* sockfd: convert to use nni_aio_startGarrett D'Amore2024-12-26
|
* posix resolver: use nni_aio_deferGarrett D'Amore2024-12-24
|
* 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.
* posix tcp: use common refcnt implementationGarrett D'Amore2024-12-22
|
* port events poller (illumos/Solaris): use atomic events maskGarrett D'Amore2024-12-22
|
* epoll: use atomic event maskGarrett D'Amore2024-12-22
|
* pollers: use atomic bit masking operations to eliminate lockssGarrett D'Amore2024-12-22
| | | | This is done for kqueue and poll. Others coming soon.
* ipc dialer: use common refcnt logicGarrett D'Amore2024-12-22
|
* poll: sign extension bug + incorrect use leads to tiny max files on macOSGarrett D'Amore2024-12-22
|
* posix IPv6: BSD platforms us netinet6/in6.hGarrett D'Amore2024-12-21
|
* posix udp: AF_INET6 fixupGarrett D'Amore2024-12-21
|
* posix udp: More explicit checks for bogus address familyGarrett D'Amore2024-12-21
| | | | | This triggered an error on FreeBSD because apparently FreeBSD will return a different value when seeing an AF_UNIX socket with UDP.
* files test: check to skip permissions before testingGarrett D'Amore2024-12-21
|
* posix udp: stop the PFD explicitly before finalizingGarrett D'Amore2024-12-21
|
* poll: fix poll based pollerGarrett D'Amore2024-12-21
|
* epoll: fixes for races and early wakeupsGarrett D'Amore2024-12-21
|
* posix: fix for IPC and TCP dialingGarrett D'Amore2024-12-21
| | | | | The dialer aio needs to be set before starting the dial operation, as the operation may complete right away.
* posix pollers: inline the pfd and make callbacks constantGarrett D'Amore2024-12-20
| | | | | | | This change moves the posix pollers to inline the PFD and makes the callbacks constant, so that we can dispense with tests, failures, and locks. It is anticipated that this will reduce lock based pressure on the bus and increase performance modestly.
* poll: performance improvements, simplificationsGarrett D'Amore2024-12-19
| | | | | | | | | | | We preallocate the arrays used for pollfds, based on what the system can tolerate (tunable with NNG_MAX_OPEN), and we change the code for inserting and removing pollfds from the list so that it can run without acquiring the locks during the main loop, only when adding or removing files. The poll() implementation is very nearly lock free in the hot code path, and soon will be.
* posix pollers: expose pfd structures (for sizes) and fix poller selectionGarrett D'Amore2024-12-19
| | | | | | | | | | | | | The poller selection in the previous poller changes for select were not quite functional. Also, while testing poll() based poller, there were problems where it simply did not work correctly, so this addresses those, and it seems to work now. The pfd structures are exposed as we intend to allow inlining them to eliminate the separate allocation and potential for failure during initialization. We also want to have plans afoot to eliminate a lot of the extra locking done done on each I/O iteration, and this is setting the foundation for that.
* kqueue: eliminate extra locking on each I/OGarrett D'Amore2024-12-18
| | | | | This should reduce lock pressure during I/O for FreeBSD and macOS, and should provide a small performance benefit.
* POSIX poller: add support for select, and for choosing the pollerGarrett D'Amore2024-12-17
| | | | | Some platforms or configurations may not have more modern options like kqueue or epoll, or may be constrained by policy.
* streams: add explicit stop functionsGarrett D'Amore2024-12-12
| | | | | | | | | | | | 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.
* windows ipc: significant refactorGarrett D'Amore2024-12-09
| | | | | | | | | | | 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.
* tests: add a test of canceling TCP stream listenerGarrett D'Amore2024-12-09
| | | | | This same test fails on Windows using IPC, and its good to know that it works flawlessly for TCP.
* performance: reference counters can use relaxed order when incrementingGarrett D'Amore2024-12-07
|
* fini: add drain mechanism for aio, reap, and task subsystemsGarrett D'Amore2024-12-07
| | | | | Make sure *everything* is drained before proceeding all the way to deallocation.
* windows ipc: check the return value of nni_aio_scheduleGarrett D'Amore2024-12-03
| | | | | This hopefully addresses a long standing bug with Windows IPC sometimes hanging on shut down.
* tests: convert files test to NUTSGarrett D'Amore2024-12-01
|
* tests: convert ipcsupp tests to NUTSGarrett D'Amore2024-11-30
|
* tests: convert tcpsupp test to NUTSGarrett D'Amore2024-11-30
| | | | Also renamed this to tcp_stream_test.
* 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.
* ipc: Add NNG_OPT_REMADDR for dialer.Garrett D'Amore2024-11-23
|
* Use 32-bit port numbers.Garrett D'Amore2024-11-21
| | | | | While TCP and UDP port numbers are 16-bits, ZT uses a larger (24-bit) port number.
* URL refactor part 1.Garrett D'Amore2024-11-18
| | | | | | | 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.
* URL u_port should be a number not a string.Garrett D'Amore2024-11-17
| | | | | | | | | | | 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.
* Cleanup POSIX platform initialization.Garrett D'Amore2024-11-11
| | | | | This also avoids a potential leak of thread attributes. although no current platform actually seems to do so.
* 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.
* Remove unused sockaddr NULL checkGarrett D'Amore2024-11-06
|
* remove nni_plat_println - we have nni_plat_printf which is good enoughGarrett D'Amore2024-11-05
|
* ipc: listener cancellation testGarrett D'Amore2024-11-05
|
* Introduce NUTS_SKIP and use it in a few tests.Garrett D'Amore2024-11-03
| | | | | This lets us see that we are skipping tests due to lack of support, and makes it a little clearer to an observer.
* 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.
* Include sys/types.h to resolve possible missing typeGarrett D'Amore2024-10-28
|
* Remove nng_stream_set function family.Garrett D'Amore2024-10-28
| | | | This was not really used or useful.