summaryrefslogtreecommitdiff
path: root/src/core/dialer.c
Commit message (Collapse)AuthorAge
* 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.
* 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 #1658 Possible use-after-free in dialerGarrett D'Amore2023-04-23
|
* Don't bump error counters for NNG_ECLOSED.Garrett D'Amore2023-02-05
|
* ID map static initialization support.Garrett D'Amore2021-12-06
| | | | This also arranges to clean up the maps at nng_fini time.
* Use static initialization for lists and mutexes.Garrett D'Amore2021-12-05
| | | | | | 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.
* SP initialization cannot fail.Garrett D'Amore2021-09-06
|
* fixes #1498 Endpoint close/shutdown could be synchronous (#1499)Garrett D'Amore2021-09-04
|
* More symbol renamingGarrett D'Amore2021-07-11
|
* More work on moving SP stuff out of common. Remove unused defs.Garrett D'Amore2021-07-10
|
* Several minor cleanups. Fix socket id stat for listener.v1.5.0Garrett D'Amore2021-07-09
|
* Fix compilation warnings (#1397)Evgeny Ermakov2021-01-02
|
* fixes #1372 nni_reap could be smallerGarrett D'Amore2020-12-19
|
* fixes #1323 stats framework is *way* to heavyGarrett D'Amore2020-11-11
| | | | | | 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.)
* fixes #1289 zerotier should have it's own copy of the id hashing codeGarrett D'Amore2020-08-16
| | | | | | | | | | | fixes #1288 id allocation can overallocate fixes #1126 consider removing lock from idhash This substantially refactors the id hash code, giving a cleaner API, and eliminating a extra locking as well as some wasteful allocations. The ZeroTier code has it's own copy, that is 64-bit friendly, as the rest of the consumers need only a simpler 32-bit API.
* fixes #1239 Use after free in tlsGarrett D'Amore2020-05-23
| | | | | Also, addressed a number of Clang-tidy complaints. Potential hangs in close addressed as well.
* fixes #1094 Consider in-lining task and aioGarrett D'Amore2020-01-08
| | | | | This only does it for rep, but it also has changes that should increase the overall test coverage for the REP protocol
* Fix compilation errors and warnings when NNG_ENABLE_STATS is OFFRobert Bielik2019-12-30
|
* fixes #1064 Potential deadlock in statistics codeGarrett D'Amore2019-12-29
| | | | | | | | fixes #1063 Include sanitizer runs in CI fixes #1068 Wssfile test sometimes fails with wrong error code While here, addressed a number of clang-tidy items, and some light cleanup of code we were already in.
* fixes #848 server hang waiting for client handshakeGarrett D'Amore2019-02-23
| | | | | | | | | | | | | | | | | | | | | | | fixes #698 Need TCP stats fixes #699 Need IPC stats fixes #701 Need TLS stats This commit addresses a problem when negotiating using one of the stream based negotiation APIs -- a slow or misbehaving peer can prevent well behaved ones from establishing a connection. The fix is a fairly significant change in how these transports link up, and it does rely on the fact that the socket only has a single accept() or connect() pending at a time (on a given endpoint that is). While here, we have completely revamped the way transport statistics are done, offering a standard API for collecting these statistics. Unfortunately, this completely borks the statistics for inproc. As we are planning to change the way inproc works soon, in order to provide more control and work on performance fixes for the message queue, we feel this is an acceptable trade-off. Furthermore, almost nobody uses inproc for anything, and even fewer people are making use of the statistics at this time.
* fixes #835 inproc should use new option APIGarrett D'Amore2018-12-31
| | | | | Some more changes to use nni_type instead of nni_opt_type are included as well.
* progress on IPC endpointsGarrett D'Amore2018-12-29
|
* fixes #831 Unify option structures, o_type is unusedGarrett D'Amore2018-12-29
|
* fixes #4 Statistics supportGarrett D'Amore2018-09-03
| | | | | | | | | | | | | | | | This introduces new public APIs for obtaining statistics, and adds some generic stats for dialers, listeners, pipes, and sockets. Also added are stats for inproc and pairv1 protocol. The other protocols and transports will have stats added incrementally as time goes on. A simple test program, and man pages are provided for this. Start by looking at nng_stat(5). Statistics does have some impact, and they can be disabled by using the advanced NNG_ENABLE_STATS (setting it to OFF, it's ON by default) if you need to build a minimized configuration.
* fixes #693 Failed dial results in hard spinGarrett D'Amore2018-08-31
|
* fixes #673 transports could benefit from access to upper layerGarrett D'Amore2018-08-27
|
* Remove dead #if 0 code in dialer.Garrett D'Amore2018-08-19
|
* fixes #654 use aio for synchronous connectGarrett D'Amore2018-08-15
|
* fixes #208 pipe start should occur before connect / acceptGarrett D'Amore2018-08-14
| | | | | | | | | | fixes #599 nng_dial sync should not return until added to socket This reintroduces the changes for the above fixes, building upon the transport modifications that we have made to eliminate the separate transport pipe start entry point. It also includes slightly reworked code during start to put a hold on the pipe when it is created, which we we drop at the end, hopefully fixing a use-after-free.
* Revert "fixes #599 nng_dial sync should not return until added to socket"Garrett D'Amore2018-08-06
| | | | | This changeset needs work. We are seeing errors described by This reverts commit d7f7c896c0ede24249ef63b1e45b1878bf4bd473.
* fixes #599 nng_dial sync should not return until added to socketGarrett D'Amore2018-08-05
| | | | | | | | | | fixes #208 pipe start should occur before connect / accept fixes #616 Race condition closing between header & body This refactors the transports to handle their own connection handshaking before passing the pipe to the socket. This changes and simplifies the setup. This also fixes a rather challenging race condition described by #616.
* fixes #601 pipe destroy can fail to close pipeGarrett D'Amore2018-07-18
|
* fixes #568 Want a single reader/write lock on socket child objectsGarrett D'Amore2018-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | fixes #170 Make more use of reaper This is a complete restructure/rethink of how child objects interact with the socket. (This also backs out #576 as it turns out not to be needed.) While 568 says reader/writer lock, for now we have settled for a single writer lock. Its likely that this is sufficient. Essentially we use the single socket lock to guard lists of the socket children. We also use deferred deletion in the idhash to facilitate teardown, which means endpoint closes are no longer synchronous. We use the reaper to clean up objects when the reference count drops to zero. We make a special exception for pipes, since they really are not reference counted by their parents, and they are leaf objects anyway. We believe this addresses the main outstanding race conditions in a much more correct and holistic way. Note that endpoint shutdown is a little tricky, as it makes use of atomic flags to guard against double entry, and against recursive lock entry. This is something that would be nice to make a bit more obvious, but what we have is safe, and the complexity is at least confined to one place.
* fixes #572 Several locking errors foundGarrett D'Amore2018-07-03
| | | | | | | | | | fixes #573 atomic flags could help This introduces a new atomic flag, and reduces some of the global locking. The lock refactoring work is not yet complete, but this is a positive step forward, and should help with certain things. While here we also fixed a compile warning due to incorrect types.
* fixes #564 Race regression caused by#522Garrett D'Amore2018-07-02
| | | | | | fixes #565 Option getting should validate sizes more aggressively fixes #563 Reconnect timeouts should be settable on dialers fixes #562 pipe test is fragile
* fixes #522 Separate out the endpoint plumbingGarrett D'Amore2018-06-27
This separates the plumbing for endpoints into distinct dialer and listeners. Some of the transports could benefit from further separation, but we've done some rather larger separation e.g. for the websocket transport. IPC would be a good one to update later, when we start looking at exposing a more natural underlying API.