Skip to content

Commit c828d9f

Browse files
committed
added buffering reads and writes to roadmap
1 parent ca8d824 commit c828d9f

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

ROADMAP.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,14 @@ So maybe we should _just_ add `tokio` support, or maybe `mio` is still used and
2828

2929
We need this to pass more autobahn tests!
3030

31+
### Buffer Reads and Writes
32+
33+
In the old crate the stream was split up into a reader and writer stream so you could
34+
have both a `BufReader` and a `BufWriter` to buffer your operations to gain some speed.
35+
However is doesn't make sense to split the stream up anymore
36+
(see [#83](https://github.com/cyderize/rust-websocket/issues/83))
37+
meaning that we should buffer reads and writes in some other way.
38+
39+
Some work has begun on this, like [#91](https://github.com/cyderize/rust-websocket/pull/91),
40+
but is this enough? And what about writing?
41+

src/client/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ impl<'u> ClientBuilder<'u> {
231231
self.connect_on(ssl_stream)
232232
}
233233

234-
// TODO: refactor and split apart into two parts, for when evented happens
235234
pub fn connect_on<S>(&mut self, mut stream: S) -> WebSocketResult<Client<S>>
236235
where S: Stream
237236
{
@@ -272,7 +271,7 @@ impl<'u> ClientBuilder<'u> {
272271
try!(write!(stream.writer(), "{}\r\n", self.headers));
273272

274273
// wait for a response
275-
// TODO: we should buffer it all, how to set up stream for this?
274+
// TODO: some extra data might get lost with this reader, try to avoid #72
276275
let response = try!(parse_response(&mut BufReader::new(stream.reader())));
277276
let status = StatusCode::from_u16(response.subject.0);
278277

src/receiver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use ws::receiver::{MessageIterator, DataFrameIterator};
1212
use stream::{AsTcpStream, Stream};
1313
pub use stream::Shutdown;
1414

15-
// TODO: buffer the readers
1615
pub struct Reader<R>
1716
where R: Read
1817
{

0 commit comments

Comments
 (0)