Commit Graph

324 Commits

Author SHA1 Message Date
Sebastian Dröge 9bf555ed07 Update version to 0.2.0 2019-11-29 20:23:30 +01:00
Sebastian Dröge 016d365829 Release 0.1.1 2019-11-29 20:10:40 +01:00
Sebastian Dröge 6eaadd613b Remove unused bytes dependency 2019-11-29 20:09:27 +01:00
Sebastian Dröge 9b7f7a02c0 Use #[pin_project] in stream implementation to get rid of remaining unsafe code
Now the whole crate has no unsafe code left.
2019-11-29 20:09:27 +01:00
Sebastian Dröge 93d4b35d4d Remove unused #[pin_project] attribute 2019-11-29 20:09:27 +01:00
Sebastian Dröge 69d9a0c364 Update dependencies 2019-11-29 20:09:27 +01:00
Sebastian Dröge 9f3a1ee30b Add proxy waiters to allow the Stream to trigger AsyncWrite operations
As a side effect also gets rid of unsafe code and raw pointers.

We have the problem that external read operations (i.e. the Stream impl)
can trigger both read (AsyncRead) and write (AsyncWrite) operations on
the underyling stream. At the same time write operations (i.e. the Sink
impl) can trigger write operations (AsyncWrite) too.
Both the Stream and the Sink can be used on two different tasks, but it
is required that AsyncRead and AsyncWrite are only ever used by a single
task (or better: with a single waker) at a time.

Doing otherwise would cause only the latest waker to be remembered, so
in our case either the Stream or the Sink impl would potentially wait
forever to be woken up because only the other one would've been woken
up.

To solve this we implement a waker proxy that has two slots (one for
read, one for write) to store wakers. One waker proxy is always passed
to the AsyncRead, the other to AsyncWrite so that they will only ever
have to store a single waker, but internally we dispatch any wakeups to
up to two actual wakers (one from the Sink impl and one from the Stream
impl).
2019-11-29 20:09:27 +01:00
Danny Browning dc9c1b3d5f Remove trace on start send 2019-11-29 20:06:26 +01:00
Danny Browning 8ed45bc110 More logging 2019-11-29 20:06:26 +01:00
Atul Bhosale eb2c63ee73 Format code using 'cargo fmt' 2019-11-18 20:11:05 +02:00
Danny Browning 6cdf141a02 Build with no default features, examples still require default features 2019-11-18 20:10:39 +02:00
Sebastian Dröge 6ed543c8bf Update to tungstenite 0.9.2 instead of tracking git master 2019-11-16 00:25:37 +01:00
Danny Browning 3ccd307be3 Update to work on stable 2019-11-16 00:24:54 +01:00
Sebastian Dröge 1764a42b19 Update to pin-project 0.4 2019-11-14 10:54:03 +01:00
Sebastian Dröge b76d8cbc03 Port/rename to async-std / async-tungstenite 2019-11-12 15:09:12 +01:00
Danny Browning 0c2779965d Add tcp dependency for net 2019-10-20 10:32:57 -06:00
Danny Browning 1cbac51d14 Bringing splitting back 2019-10-19 11:15:18 -06:00
Danny Browning 46ac847977 Use tokio built in dns 2019-10-09 10:24:41 -06:00
Danny Browning 3821e0952a Tokio 0.2 Conversion
Update to use tokio 0.2 ecosystem to integrate with tungstenite.
2019-10-08 09:42:38 -06:00
Daniel Abramov 59ca2c885e
Merge pull request #65 from vorot93/rust-2018
Upgrade to Rust 2018, format the code
2019-08-21 16:36:43 +02:00
Artem Vorotnikov 9bd5f01784
Upgrade to Rust 2018, format the code 2019-08-20 18:54:03 +03:00
Daniel Abramov 9cf7243860
Merge pull request #63 from najamelan/cleanup
Cleanup
2019-08-12 17:36:15 +02:00
Naja Melan 380f531d86 Fix some clippy warnings about unnecessary closures for more concise code 2019-08-10 19:23:00 +02:00
Naja Melan 0793764dcd Add `dyn` to silence compiler warnings 2019-08-10 19:19:55 +02:00
Daniel Abramov 52f74684ee Bump version 2019-08-08 14:24:35 +02:00
Daniel Abramov 952b4b2410 Update to the new `tungstenite-rs` 2019-08-08 14:23:52 +02:00
Alexey Galakhov 09ba8d733f Version 0.8.0 released.
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
2019-05-17 03:12:22 +02:00
Alexey Galakhov 8b13cb7ad3 test: add autobahn tests
Signed-off-by: Alexey Galakhov <agalakhov@snapview.de>
2019-05-17 03:11:03 +02:00
Daniel Abramov e2cdf11bc8 Update to the latest `tungstenite-rs` version 2019-05-16 14:56:40 +02:00
Daniel Abramov 4c60589773
Merge pull request #57 from dfaust/master
Depend on tungstenite master branch
2019-04-07 12:19:33 +02:00
Daniel Faust 334148fff5 Depend on tungstenite master branch 2019-04-06 09:34:14 +02:00
Alexey Galakhov 203fa0b2bd
Merge pull request #54 from nimiq/jeff/upstream_get_remote_address
Implement support to get the remote address
2019-02-13 09:32:20 +01:00
Jeffrey Esquivel S eda57a012c
Implement support to get the peer address 2019-02-12 18:01:00 -06:00
Alexey Galakhov eb7b3df7c7
Merge pull request #53 from snapview/close-as-message
Introduce `Message::Close` support and return `Async::Ready(None)` when the stream is ended
2019-02-07 16:39:48 +01:00
Daniel Abramov b9e6e59dce Bump version 2019-02-07 15:14:39 +01:00
Daniel Abramov 7d2f0c9ffb Return `Close` messages to the user
Solves #45 and #51
2019-02-07 15:11:52 +01:00
Daniel Abramov 1dcf833f6a
Merge pull request #48 from zargony/optional_tls_stream_type
Add `MaybeTlsStream` wrapper type for streams that might be protected with TLS
2018-08-13 13:31:49 +02:00
Daniel Abramov b2eaf03876
Merge pull request #49 from jeffesquivels/update_comment
Update comment to reflect current code
2018-08-13 13:29:31 +02:00
Jeffrey Esquivel S 6c3b8a5137
Update comment to reflect current code 2018-08-11 12:12:46 +02:00
Andreas Neuhaus 430c06048d Add `MaybeTlsStream` wrapper type for streams that optionally use TLS
Connecting to a URL wraps the connection into this wrapper type based
on the protocol of the URL (`ws:` or `wss:`). Making this type public
allows client applications to specify the websocket's type without
importing the tokio_tls crate.
2018-08-10 11:13:29 +02:00
Daniel Abramov e3174bf2a2
Merge pull request #47 from mehcode/feature/upgrade-tokio
Update tokio-tls to 0.2 and replace fully tokio-core with tokio
2018-08-09 15:31:54 +02:00
Ryan Leckey b9b6f2de5a Update tokio-tls to 0.2 and replace fully tokio-core with tokio 2018-08-09 00:59:28 -07:00
Daniel Abramov 9f3b559555 Bump version 2018-07-20 12:10:26 +02:00
Daniel Abramov f4b1e78475 Update important dependencies 2018-07-20 12:09:55 +02:00
Alexey Galakhov d43c61428e
Merge pull request #46 from snapview/update-dependencies
Update to the newest `tungstenite-rs` version
2018-07-19 19:47:34 +02:00
Daniel Abramov b61ed96561 Update to the newest `tungstenite-rs` version
* Fixes #35
* Replaces https://github.com/snapview/tokio-tungstenite/pull/40
* Gives a good background for https://github.com/snapview/tokio-tungstenite/pull/41
2018-07-19 17:21:41 +02:00
Daniel Abramov 8b3f811be7
Merge pull request #43 from slowtec/fix-42
fix tokio import
2018-07-02 11:10:31 +02:00
Markus Kohlhase 475486a0a1 fix tokio import 2018-06-20 18:12:38 +02:00
Daniel Abramov 9740711083
Merge pull request #39 from sbruton/master
upgrades tokio-dns-unofficial to fix nightly toolchain
2018-06-18 21:05:17 +02:00
Juan Crouton 55c2b7b396
upgrades tokio-dns-unofficial to fix nightly toolchain 2018-06-18 13:20:19 -05:00