summaryrefslogtreecommitdiff
path: root/tests/platform.c
Commit message (Collapse)AuthorAge
* 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 #2 Websocket transportGarrett D'Amore2017-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a rather large changeset -- it fundamentally adds websocket transport, but as part of this changeset we added a generic framework for both HTTP and websocket. We also made some supporting changes to the core, such as changing the way timeouts work for AIOs and adding additional state keeping for AIOs, and adding a common framework for deferred finalization (to avoid certain kinds of circular deadlocks during resource cleanup). We also invented a new initialization framework so that we can avoid wiring in knowledge about them into the master initialization framework. The HTTP framework is not yet complete, but it is good enough for simple static serving and building additional services on top of -- including websocket. We expect both websocket and HTTP support to evolve considerably, and so these are not part of the public API yet. Property support for the websocket transport (in particular address properties) is still missing, as is support for TLS. The websocket transport here is a bit more robust than the original nanomsg implementation, as it supports multiple sockets listening at the same port sharing the same HTTP server instance, discriminating between them based on URI (and possibly the virtual host). Websocket is enabled by default at present, and work to conditionalize HTTP and websocket further (to minimize bloat) is still pending.
* 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.
* 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.
* 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.)
* Many fixes for Windows. It compiles, and some tests work.Garrett D'Amore2017-01-13
| | | | | | Windows is getting there. Needs a couple of more more hours to enable everything, especially IPC, and most of the work at this point is probably some combination of debug and tweaking things like error handling.
* Valgrind test fixes (leaks due to unreaped threads.)Garett D'Amore2017-01-01
|
* Stack related fixes for valgrind platform test.Garrett D'Amore2017-01-01
|
* Fix possible race in platform test.Garrett D'Amore2017-01-01
|
* New thread infrastructure -- not used anywhere yet, but tested.Garrett D'Amore2017-01-01
|
* Add thread & condition variable checks to platform tests.Garrett D'Amore2016-12-23
|
* Coarse clocks can return exact times.Garrett D'Amore2016-12-23
|
* Fix for incorrect nni_usleep(), found with newly created platform tests.Garrett D'Amore2016-12-23