* Add automatic constructors for TCP and UDP transports.
* Add port number argument.
Add some documentation comments.
Fix tests.
* Make datagram test use request/response scheme.
* Add helper.
* Fix issue with non-zero port setups.
Add test.
* Fix tests to probe ports.
* Attempt to fix MacOS issue.
* Add Opt[IpAddress].
Make IPv4 mapping to IPv6 space automatic.
* Add tests.
* Add stream capabilities.
* Fix Linux issues.
* Make getTransportFlags() available for all OSes.
* Fix one more compilation issue.
* Workaround weird compiler bug.
* Fix forgotten typed version of constructor.
* Make single source for addresses calculation.
* Add one more check into tests.
* Fix flags not being set in transport constructor.
* Fix post-rebase issues with flags not being set.
* Address review comments.
In `stream.readLoop`, a finished `Future` was left in `transp.reader`
if there was an error in `resumeRead`. Set it to `nil` as well.
Co-authored-by: Jacek Sieka <jacek@status.im>
We can check at compile-time that at least one parameter is passed
* clean up closure environment explicitly in some callbacks to release
memory earlier
* Fix `or` should not create future with OwnCancelSchedule flag set.
* Fix `CancelledError` missing from raises list when both futures has empty raises list.
* Fix macros tests.
```nim
import chronos
proc f(): Future[void] {.async: (raises: []).} =
discard
discard f() or f() or f()
```
```
/Users/etan/Documents/Repos/nimbus-eth2/vendor/nim-chronos/chronos/internal/raisesfutures.nim(145, 44) union
/Users/etan/Documents/Repos/nimbus-eth2/vendor/nimbus-build-system/vendor/Nim/lib/core/macros.nim(185, 28) []
/Users/etan/Documents/Repos/nimbus-eth2/test.nim(6, 13) template/generic instantiation of `or` from here
/Users/etan/Documents/Repos/nimbus-eth2/vendor/nim-chronos/chronos/internal/asyncfutures.nim(1668, 39) template/generic instantiation of `union` from here
/Users/etan/Documents/Repos/nimbus-eth2/vendor/nimbus-build-system/vendor/Nim/lib/core/macros.nim(185, 28) Error: illegal conversion from '-1' to '[0..9223372036854775807]'
```
Fix by checking for `void` before trying to access `raises`
* Add more specific accept() exceptions raised.
Add some refactoring to HTTP server code.
* Refactor acceptLoop.
* Print GC statistics in every failing test.
* Try to disable failing tests.
Features:
* Exception effects / raises for async procedures helping you write more
efficient leak-free code
* Cross-thread notification mechanism for suitable building channels,
queues and other multithreaded primitives
* Async process I/O
* IPv6 dual stack support
* HTTP middleware support alloing multiple services to share a single
http server
* A new [documentation web
site](https://status-im.github.io/nim-chronos/) covering the basics,
with several simple examples for getting started
* Implicit returns, support for `results.?` and other conveniences
* Rate limiter
* Revamped cancellation support with more control over the cancellation
process
* Efficiency improvements with `lent` and `sink`
See the [porting](https://status-im.github.io/nim-chronos/porting.html)
guides for porting code from earlier chronos releases (as well as
asyncdispatch)
Feature flags allow consumers of chronos to target versions with and
without certain features via compile-time selection. The first feature
flag added is for raise tracking support.
* simplify `closeWait` implementations
* remove redundant cancellation callbacks
* use `noCancel` to avoid forgetting the right future flags
* add a few missing raises trackers
* enforce `OwnCancelSchedule` on manually created futures that don't raise `CancelledError`
* ensure cancellations don't reach internal futures
Because the callback types were used explicitly in some consumers of
chronos, the change of type introduces a backwards incompatibility
preventing a smooth transition to v4 for code that doesn't uses
`raises`.
This PR restores backwards compatibility at the expense of introducing a
new type with a potentially ugly name - that said, there is already
precedence for using numbered names to provide new error handling
strategy in chronos.