aboutsummaryrefslogtreecommitdiff
path: root/src/protocol
Commit message (Collapse)AuthorAge
* Add init/fini to protocols to allow them to register options.Garrett D'Amore2017-08-23
|
* Implement dynamic option numbering.Garrett D'Amore2017-08-23
| | | | | | | This permits option numbers to be allocated based on string name. Eventually all the option values will be replaced with option names. This will facilitate transports (ZeroTier) that may need further options.
* Provide versions of mutex, condvar, and aio init that never fail.Garrett D'Amore2017-08-16
| | | | | | | | | | | | | | | | | | | | | | | If the underlying platform fails (FreeBSD is the only one I'm aware of that does this!), we use a global lock or condition variable instead. This means that our lock initializers never ever fail. Probably we could eliminate most of this for Linux and Darwin, since on those platforms, mutex and condvar initialization reasonably never fails. Initial benchmarks show little difference either way -- so we can revisit (optimize) later. This removes a lot of otherwise untested code in error cases and so forth, improving coverage and resilience in the face of allocation failures. Platforms other than POSIX should follow a similar pattern if they need this. (VxWorks, I'm thinking of you.) Most sane platforms won't have an issue here, since normally these initializations do not need to allocate memory. (Reportedly, even FreeBSD has plans to "fix" this in libthr2.) While here, some bugs were fixed in initialization & teardown. The fallback code is properly tested with dedicated test cases.
* Convert duration to usec.Garrett D'Amore2017-08-14
|
* REP drops peers a little too aggressively.Garrett D'Amore2017-08-14
| | | | | | | | We noticed that certain failure modes were exposed in tests that were caused by us closing the underlying pipe when certain messaging errors occurred. Discarding the pipe is the wrong answer; instead we should discard the message and keep the pipe open (unless the message is so malformed that the remote party cannot be trusted.)
* Fix leaks found in pairv1 test suite.Garrett D'Amore2017-08-11
|
* Fail to another stream on default (no pipe requested).Garrett D'Amore2017-08-11
|
* Fix TTL handling for pair1 protocol; more tests.Garrett D'Amore2017-08-11
|
* Test support for pairv1 including polyamorous mode.Garrett D'Amore2017-08-11
|
* Unify the msg API.Garrett D'Amore2017-08-10
| | | | | | | | | | | | | This makes the operations that work on headers start with nni_msg_header or nng_msg_header. It also renames _trunc to _chop (same strlen as _trim), and renames prepend to insert. We add a shorthand for clearing message content, and make better use of the endian safe 32-bit accessors too. This also fixes a bug in inserting large headers into messages. A test suite for message handling is included.
* Add new PAIR_V1 protocol.Garrett D'Amore2017-08-10
| | | | | | | | | | The PAIR_V1 protocol supports both raw and cooked modes, and has loop prevention included. It also has a polyamorous mode, wherein it allows multiple connections to be established. In polyamorous mode (set by an option), the sender requests a paritcular pipe by setting it on the message. We default to PAIR_V1 now.
* fixes #44 open protocol by "name" (symbol) instead numberGarrett D'Amore2017-08-09
| | | | | | | | | | | | | | fixes #38 Make protocols "pluggable", or at least optional This is a breaking change, as we've done away with the central registered list of protocols, and instead demand the user call nng_xxx_open() where xxx is a protocol name. (We did keep a table around in the compat framework though.) There is a nice way for protocols to plug in via an nni_proto_open(), where they can use a generic constructor that they use to build a protocol specific constructor (passing their ops vector in.)
* Added nn_compat code for option handling, fixed other bugs.Garrett D'Amore2017-08-08
| | | | | | | Hop counts for REQ were busted (bad TTL), and imported the compat_reqtll test. At the same time, added code to nn_term to shut down completely, discarding sockets. (Note that some things, such as globals, may still be left around; that's ok.)
* Yet more race condition fixes.Garrett D'Amore2017-07-20
| | | | | | | | | We need to remember that protocol stops can run synchronously, and therefore we need to wait for the aio to complete. Further, we need to break apart shutting down aio activity from deallocation, as we need to shut down *all* async activity before deallocating *anything*. Noticed that we had a pipe race in the surveyor pattern too.
* Crash on close again.Garrett D'Amore2017-07-19
| | | | | | | | | | | This one is caused by us deallocating the msg queue before we stop all asynchronous I/O operations; consequently we can wind up with a thread trying to access a msg queue after it has been destroyed. A lesson here is that nni_aio_fini() needs to be treated much like nni_thr_fini() - you should do this *before* deallocating anything that callback functions might be referencing.
* Fix incorrect attempt to proceed inproc.Garrett D'Amore2017-07-15
|
* More s/nni_aio_stop/nni_aio_cancel/Garrett D'Amore2017-07-15
|
* Bus, Req/Rep, and Surv/Resp should use aio_cancel instead of aio_stop.Garrett D'Amore2017-07-15
|
* Now that idhash is locked, we can ditch some locking in protocols.Garrett D'Amore2017-07-13
|
* Make idhash non-inlined (so we can add a mutex.)Garrett D'Amore2017-07-13
|
* Give up on uncrustify; switch to clang-format.Garrett D'Amore2017-07-10
|
* Various cleanups of unused bits.Garrett D'Amore2017-07-08
|
* Clean up some unused variables.Garrett D'Amore2017-07-07
|
* Use common aio cancellation.Garrett D'Amore2017-07-02
|
* Remove the extra _aio_ part of pipe send and recv functions.Garrett D'Amore2017-07-02
|
* We don't need pipe_hold or pipe_rele anymore.Garrett D'Amore2017-06-28
|
* Refactor stop again, closing numerous races (thanks valgrind!)Garrett D'Amore2017-06-28
|
* More race condition fixes.Garrett D'Amore2017-06-26
|
* Protocols keep their own reference counts.Garrett D'Amore2017-06-24
|
* Make APIs for holding references more consistent.Garrett D'Amore2017-06-21
|
* Don't dereference the psock on an error.Garrett D'Amore2017-06-09
|
* Pipe ID race on close (pipe IDs are zero at close).Garrett D'Amore2017-04-14
| | | | | This should address some of the errors we've seen. Additionally, the scalability test was a bit brittle due to too-short timeouts.
* Hopefully close shutdown race in rep.Garrett D'Amore2017-03-29
|
* Eliminate p_active, better names for pipe start and stop.Garrett D'Amore2017-03-19
|
* Notification working - separate thread now.Garrett D'Amore2017-03-11
|
* Surveyor pattern callback-driven.Garrett D'Amore2017-03-10
|
* Race condition fixes in pub/sub.Garrett D'Amore2017-03-10
|
* Pipeline is now race free (and simpler to boot!)Garrett D'Amore2017-03-10
|
* Bus protocol close races fixed.Garrett D'Amore2017-03-10
|
* Start of close related race fixes. Scalability test.Garrett D'Amore2017-03-10
|
* Req/Rep now callback driven.Garrett D'Amore2017-03-07
|
* Initial work on REP callback handling.Garrett D'Amore2017-03-06
|
* Pub/Sub now callback driven.Garrett D'Amore2017-03-06
|
* Pair protocol now callback driven.Garrett D'Amore2017-03-06
|
* Bus protocol now callback-driven.Garrett D'Amore2017-03-05
|
* Pipeline protocol now entirely callback driven.Garrett D'Amore2017-03-04
|
* Add device support & testing. Bus semantic fix.Garrett D'Amore2017-01-27
| | | | | | | | | | | This adds nn_device and nng_device. There were some internal changes required to fix shutdown / close issues. Note that we shut down the sockets when exiting from device -- this is required to make both threads see the failure and bail, since we are not using a single event loop. I also noticed that the bus protocol had a bug where it would send messages back to the originator. This was specifically tested for in the compat_device test, and we have fixed it.
* Add endpoint tuning of maxrcv size. Fix cmsg API.Garrett D'Amore2017-01-24
| | | | | | | | | | | | | | The CMSG handling was completely borked. This is fixed now, and we stash the SP header size (ugh) in the CMSG contents to match what nanomsg does. We now pass the cmsg validation test. We also fixed handling of certain endpoint-related options, so that endpoints can get options from the socket at initialization time. This required a minor change to the transport API for endpoints. Finally, we fixed a critical fault in the REP handling of RAW sockets, which caused them to always return NNG_ESTATE in all cases. It should now honor the actual socket option.
* Added a bunch more compatibility stuff.Garrett D'Amore2017-01-23
| | | | | | | | I implemented the reqrep compatibility test, which uncovered a few semantic issues I had in the REQ/REP protocol, which I've fixed. There are still missing things. and at least one portion of the req/rep test suite cannot be enabled until I add tuning of the reconnect timeout, which is currently way too long (1 sec) for the test suite to work.
* Event notification via pollable FDs verified working.Garrett D'Amore2017-01-22
|