aboutsummaryrefslogtreecommitdiff
path: root/src/core/sockimpl.h
Commit message (Collapse)AuthorAge
* Eliminate the pipe mutex and use atomic for pipe closed.Garrett D'Amore2021-09-06
| | | | | | | | | | 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 #1498 Endpoint close/shutdown could be synchronous (#1499)Garrett D'Amore2021-09-04
|
* Minor cleanups.Garrett D'Amore2021-08-21
|
* Minor format and spelling in comments.Garrett D'Amore2021-07-31
|
* More work on moving SP stuff out of common. Remove unused defs.Garrett D'Amore2021-07-10
|
* 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 #1104 move allocation of protocol objects to common coreGarrett D'Amore2020-01-03
| | | | fixes #1103 respondent could inline backtrace
* 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 #782 stat namespace collision on QNXGarrett D'Amore2018-11-09
|
* 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 #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.