| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
Basically, we have moved the compat stuff into a separate directory.
Compatibility layer users will have to update their compile flags, but
should be able to avoid changing any *source* files with this change.
|
| |
|
|
|
|
|
| |
We enabled verbose compiler warnings, and found a lot of issues.
Some of these were even real bugs. As a bonus, we actually save
some initialization steps in the compat layer, and avoid passing
some variables we don't need.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes all the protocols and transports optional. All
of them except ZeroTier are enabled by default, but you can
now disable them (remove from the build) with cmake options.
The test suite is modified so that tests still run as much
as they can, but skip over things caused by missing functionality
from the library (due to configuration).
Further, the constant definitions and prototypes for functions
that are specific to transports or protocols are moved into
appropriate headers, which should be included directly by
applications wishing to use these.
We have also added and improved documentation -- all of the
transports are documented, and several more man pages for
protocols have been added. (Req/Rep and Surveyor are still
missing.)
|
| | |
|
| |
|
|
|
|
| |
There is now a public nng_duration type. We have also updated the
zerotier work to work with the signed int64_t's that the latst ZeroTier
dev branch is using.
|
| |
|
|
|
|
|
|
| |
The NNG_OPT_SOCKNAME option is settable, to a limit of 64 bytes.
The NNG_OPT_DOMAIN is read-only, but changes to match the setting
of the NNG_OPT_RAW field. New applications should not use the
NNG_OPT_DOMAIN option -- it is provided solely for use with the
legacy NN_DOMAIN option in the compatibility layer.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This makes the APIs use string keys, and largely eliminates the use of
integer option IDs altogether. The underlying registration for options
is also now a bit richer, letting protcols and transports declare the
actual options they use, rather than calling down into each entry point
carte blanche and relying on ENOTSUP.
This code may not be as fast as the integers was, but it is more intuitive,
easier to extend, and is not on any hot code paths. (If you're diddling
options on a hot code path you're doing something wrong.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This eliminates all the old #define's or enum values, making all
option IDs now totally dynamic, and providing well-known string
values for well-behaved applications.
We have added tests of some of these options, including lookups, and
so forth. We have also fixed a few problems; including at least
one crasher bug when the timeouts on reconnect were zero.
Protocol specific options are now handled in the protocol. We will
be moving the initialization for a few of those well known entities
to the protocol startup code, following the PAIRv1 pattern, later.
Applications must therefore not depend on the value of the integer IDs,
at least until the application has opened a socket of the appropriate
type.
|
| |
|
|
|
| |
Also enables creating endpoints that are idle (first part of
endpoint options API) and shutting down endpoints.
|
| |
|
|
|
|
|
|
|
|
|
| |
fixes #66 Make pipe and endpoint structures private
This changes a number of things, refactoring endpoints and supporting
code to keep their internals private, and making endpoint close
synchronous. This will allow us to add a consumer facing API for
nng_ep_close(), as well as property APIs, etc.
While here a bunch of convoluted and dead code was cleaned up.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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 #23 Restore the old idhash logic for sockets
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
| | |
|
| |
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
|
|
|
| |
We noticed a bug in the surveyor handling of the options; this fixes
that. At the same time, we noticed a race condition in the setting
of the error for future calls, a short sleep seems to cure it. This
distinction (ESTATE vs ETIMEDOUT) is pretty annoying, and it would be
better to have a different way to handle it. More work here is
warranted.
|
| |
|
|
|
|
|
|
|
| |
We introduced the compat_msg.c from the old msg.c in the nanomsg
repo. While here, we found that the handling for send() was badly
wrong, by a level of indirection. We simplified the code to so that
nn_send() and nn_recv() are simple wrappers around the nn_sendmsg()
and nn_recvmsg() APIs (as in old nanomsg). This may not be quite as
fast, but it's more likely to be correct and reduces complexity.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
Also, while here fixed a bug for the PAIR protocol in compat mode.
It should now be possible to import more of the nanomsg tests directly
with little or no modification.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|