summaryrefslogtreecommitdiff
path: root/tests/sock.c
Commit message (Collapse)AuthorAge
* fixes #331 replace NNG_OPT_RAW option with constructorGarrett D'Amore2018-04-04
| | | | | | | | | | | | | This makes the raw mode something that is immutable, determined at socket construction. This is an enabling change for the separate context support coming soon. As a result, this is an API breaking change for users of the raw mode option (NNG_OPT_RAW). There aren't many of them out there. Cooked mode is entirely unaffected. There are changes to tests and documentation included.
* fixes #329 type checking not done for setoptGarrett D'Amore2018-04-04
|
* fixes #301 String option handling for getoptGarrett D'Amore2018-03-20
|
* fixes #296 Typed options should validate option typeGarrett D'Amore2018-03-20
| | | | | | | | | | | | | fixes #302 nng_dialer/listener/pipe_getopt_sockaddr desired This adds plumbing to pass and check the type of options all the way through. NNG_ZT_OPT_ORBIT is type UINT64, but you can use the untyped form to pass two of them if needed. No typed access for retrieving strings yet. I think this should allocate a pointer and copy that out, but that's for later.
* fixes #295 boolean options should use C99 bool typeGarrett D'Amore2018-03-18
| | | | | | | | | | | fixes #275 nng_pipe_getopt_ptr() missing? fixes #285 nng_setopt_ptr MIS fixes #297 nng_listener/dialer_close does not validate mode This change adds some missing APIs, and changes others. In particular, certain options are now of type bool, with size of just one. This is a *breaking* change for code that uses those options -- NNG_OPT_RAW, NNG_OPT_PAIR1_POLY, NNG_OPT_TLS_VERIFIED.
* fixes #287 remove NNG_OPT_DOMAIN, NNG_OPT_PROTOCOL, and NNG_OPT_TRANSPORTGarrett D'Amore2018-03-17
| | | | | While here we documented that certain options are not supported in the compatibility layer.
* Introduce 'porting layer' Public API.Garrett D'Amore2018-02-20
| | | | | | | This introduces portable primitives for time, random numbers, synchronization primitives, and threading. These are somewhat primitive (least common denominiators), but they can help with writing portable applications, especially our own demo apps.
* fixes #234 Investigate enabling more verbose compiler warningsGarrett D'Amore2018-02-14
| | | | | | | 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.
* fixes #143 Protocols and transports should be "configurable"Garrett D'Amore2017-11-02
| | | | | | | | | | | | | | | | | | | | 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.)
* fixes #137 Remove public access to numeric protocolsGarrett D'Amore2017-10-31
|
* fixes #136 consider eliminating nng_shutdownGarrett D'Amore2017-10-30
|
* fixes #84 Consider using msec for durationsGarrett D'Amore2017-10-19
| | | | | | 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.
* Add NNG_OPT_DOMAIN and NNG_OPT_SOCKNAME support for legacy compat.Garrett D'Amore2017-10-06
| | | | | | | | 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.
* Added more complete tests, and changes to property handling.Garrett D'Amore2017-10-02
| | | | | | | | | | | | | | | | We allow some properties to be set on endpoints after they are started; transports now responsible for checking that. (The new values will only apply to new connections of course!) We added short-hand functions for pipe properties, and also added uint64_t shorthands across the board. The zerotier documentation got some updates (corrections). We have also added a separate header now for the ZT stuff. Also, dialers and listeners do not intermix anymore -- we test that only a dialer can be used with setting dialer options, and likewise for listeners.
* Refactor option handling APIs.Garrett D'Amore2017-09-27
| | | | | | | | | | | | 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.)
* ZeroTier transport implementation (work funded by Capitar IT Group BV)Garrett D'Amore2017-09-26
| | | | | | | | | | | | | The ZeroTier transport is experimental at this point, and not enabled by default. It does not work with Windows yet (the Windows platform needs UDP support first.) Configure with -DNNG_ENABLE_ZEROTIER=yes -DNNG_ZEROTIER_SOUCE=<path> The <path> must point to a dev branch of the ZeroTierOne source tree, checked out, and built with a libzerotiercore.a in the top directory, and a ZeroTierOne.h header located at include. The build will add -lc++ to the compile, as the ZeroTier core functionality is written in C++ and needs some runtime support (e.g. new, delete, etc.)
* More pipe option handling, pipe API support. Url option.Garrett D'Amore2017-09-22
| | | | | | | | | | This fleshes most of the pipe API out, making it available to end user code. It also adds a URL option that is independent of the address options (which would be sockaddrs.) Also, we are now setting the pipe for req/rep. The other protocols need to have the same logic added to set the receive pipe on the message. (Pair is already done.)
* Eliminate legacy option settings, provide easier option IDs.Garrett D'Amore2017-08-24
| | | | | | | | | | | | | | | | | | 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.
* Endpoint API completely implemented.Garrett D'Amore2017-08-18
| | | | | | This supports creating listeners and dialers, managing options on them (though only a few options are supported at present), starting them and closing them, all independently.
* Convert duration to usec.Garrett D'Amore2017-08-14
|
* fixes #63 NNG_FLAG_SYNCH should be the defaultGarrett D'Amore2017-08-14
| | | | | Also enables creating endpoints that are idle (first part of endpoint options API) and shutting down endpoints.
* Idempotent taskq finalizers.Garrett D'Amore2017-08-14
|
* Convenience option accesor functions.Garrett D'Amore2017-08-12
| | | | | | | | This adds functions that know about option sizes and make them easier to use. While here I added some validation of those, and cleaned up a few tests slightly. Note that we do not need to use the nng_impl.h for most tests. More of them need to be cleaned up.
* Windows fixes; especially idempotent init/fini.Garrett D'Amore2017-08-11
| | | | | | | This fixes one major problem, which was that if nni_fini() was called once on Windows, it would not be further possible to call nni_init(). While here fixed a few compilation issues.
* Leaking poll fds.Garrett D'Amore2017-08-11
| | | | | | | We never set the fd->sn_init member, causing new fds to be allocated on each request for a new pollfd, and causing old ones to leak, and worse may be even to not get notified. While here, we arrange for a bit richer testing against the various options.
* 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.)
* Make reqrep test more robust; sock test faster.Garrett D'Amore2017-06-25
|
* Fix leaks in bus, socket leaks, tighten up close-side refcnting.Garrett D'Amore2017-01-21
| | | | | | | | | | | | | | This does a few things. First it closes some preexisting leaks. Second it tightens the overall close logic so that we automatically discard idhash resources (while keeping numeric values for next id etc. around) when the last socket is closed. This then eliminates the need for applications to ever explicitly terminate resources. It turns out platform-specific resources established at nni_init() time might still be leaked, but it's also the case that we now no longer dynamically allocate anything at platform initialization time. (This presumes that the platform doesn't do so under the hood when creating critical sections or mutexes for example.)
* Implement nng_send and nng_recv convenience routines.Garrett D'Amore2017-01-21
|
* Dangling compiler warnings from sock handle change.Garrett D'Amore2017-01-20
|
* fixes #18 Sockets should be uint32_t's (handles) not pointers.Garrett D'Amore2017-01-20
|
* Windows compilation fixes.Garrett D'Amore2017-01-18
|
* Fixes for valgrind issues.Garrett D'Amore2017-01-18
|
* Various complaints found in AppVeyor build.Garrett D'Amore2017-01-16
|
* Use Windows tick clock instead of Performance counters.Garrett D'Amore2017-01-14
| | | | | | | | | | | | Since we use the tick counter to sleep, we should use the same clock for validation. The problem is that the high performance tick counter on the CPU may be slightly out of agreement with the windows clock. Furthermore, the tick counter is probably lots faster to retrieve since it is already updated, and needn't be recalculated each time. (We should consider just switching to millisecond clock resolution internally as well. It turns out that I don't think that timers that are shorter than 1ms are very useful.)
* Fix for valgrind leak.Garrett D'Amore2017-01-06
|
* Bunch of copyright fixes.Garrett D'Amore2017-01-06
|
* Message API was awkward.Garrett D'Amore2017-01-06
| | | | | | | The use of a single function to get both size and length actually turned out to be awkward to use; better to have separate functions to get each. While here, disable some of the initialization/fork checks, because it turns out they aren't needed.
* Add nng_shutdown() for sockets to help avoid close race.Garrett D'Amore2017-01-05
| | | | Also we added a two phase shutdown for threads.
* Send and receive now work.Garrett D'Amore2016-12-27
| | | | | | This fixes a few core issues, and improves readability for the message queue code as well. inproc delivery of messages works now.
* Buffer resizing implemented. (Needed for single threaded inproc tests.)Garrett D'Amore2016-12-27
|
* Substantial fixes for listen & dialers.Garrett D'Amore2016-12-25
| | | | | | | | | | At this point listening and dialing operations appear to function properly. As part of this I had to break the close logic up since otherwise we had a loop trying to reap a thread from itself. So there is now a separate reaper thread for pipes per-socket. I also changed lists to be a bit more rigid, and allocations now zero memory initially. (We had bugs due to uninitialized memory, and rather than hunt them all down, lets just init them to sane zero values.)
* New dial/listen API. Dialing might work now.Garrett D'Amore2016-12-25
| | | | | | | | | In order to give control over synchronous vs. async dialing, we provide a flag to indicate synchronous dialing is desired. (Hmm. Should we reverse the default sense?) We extend listen to have the same flag. Logic is moved to endpt.c since dialing is really and endpoint specific operation. There are other minor related bug fixes here too.
* Expose nng_sendmsg.Garrett D'Amore2016-12-24
|
* Getopt implemented (and minimal test).Garrett D'Amore2016-12-24
|
* Fix for incorrect nni_usleep(), found with newly created platform tests.Garrett D'Amore2016-12-23
|
* nng_setopt works (rcvtimeout, etc.) External API adjustments.Garrett D'Amore2016-12-23
| | | | | | | The external API now uses simpler names for various things, notably we ditch the whole nng_socket_xx prefix. For example, intstead of nng_socket_create, we just use nng_open(). There are no more nng_socket_xxx calls.
* Try to satisfy uncrustify version differences. Make test use verbose by ↵Garrett D'Amore2016-12-23
| | | | default.
* Some tests around recvmsg (no senders yet). Fixes for some edge cases.Garrett D'Amore2016-12-23
|
* Initial tests -- open & close work (no pipes or endpoints yet).Garrett D'Amore2016-12-23