

A Simple Network Client in Rust - wyc
http://blog.wycd.net/a-simple-network-client-in-rust/#header

======
nulldata
Another less verbose way of handling the results of the writes is the
'and_then' method which short circuits on 'Err' or otherwise calls the given
closure ( which only borrows it's environment ) with the previous value and
returns the 'Result'.

------
ivanr
You might want to add "Connection: close" to the request. Otherwise the server
won't close the connection immediately, but only after a keep-alive timeout.
In the meantime, your program will be waiting to read on the socket. In some
cases you might even get an additional 408 response. Changing protocol to 1.0
should also work.

------
zokier
> This means that stream.read_to_end() can only return a maximum of
> DEFAULT_BUF_SIZE bytes.

That doesn't sound right. push_at_least() is called inside a loop, which looks
very much like it should be able to read arbitrarily large amounts of data.

~~~
wyc
you're right! i've corrected it and credited you. thank you.

