431 Commits

Author SHA1 Message Date
Sebastian Thiel
5adde38a65 Allocation in get_mut() always uses 8 * 1024 bytes
The previous implementation would always use the capacity
of the previous buffer, which would effectively prevent it
from ever shrinking.

This also means that protocol with greater variance in
possible frame sizes would likely be heavily over-allocating.
If these implementations use zero-copy, this would imply
that even small frames kept alive by the client would use
large amounts of memory.

The change is motivated by the implementation of the
cassandra-protocol, which allows frames of up to 256MB
in size, which solely depend on the kind of query.
2017-02-11 09:01:07 +01:00
Alex Crichton
574b6f0c54 Merge pull request #162 from manuel-woelker/master
impl Into<Vec<u8>> for EasyBuf (cf. #120)
2017-02-10 18:32:00 -06:00
Manuel Woelker
b4cd223476 impl Into<Vec<u8>> for EasyBuf (cf. #120) 2017-02-10 23:01:46 +01:00
Manuel Woelker
f86addf113 fix allocating EasyBuf::get_mut() leaving vector too large (cf. #162) 2017-02-10 22:58:16 +01:00
Alex Crichton
a4017ee846 Merge pull request #164 from fortytw2/patch-1
rename sock -> listener in docs
2017-02-08 12:40:33 -08:00
Ian Chiles
8a360f87f5 rename sock -> listener in docs
Makes it much clearer for someone fairly new to rust (like me) to follow along when the same named variable aren't totally different things :)
2017-02-08 20:23:54 +01:00
Alex Crichton
cecaad715d Merge pull request #161 from seeekr/patch-1
Fix typo in non-doc comment in copy.rs
2017-01-27 14:49:41 -08:00
Denis Andrejew
e31b76c047 Fix typo in non-doc comment in copy.rs 2017-01-27 22:42:04 +00:00
Alex Crichton
05f01d6c9b Merge pull request #157 from seanmonstar/vecio
add read_bufs and write_bufs to Io and TcpStream
2017-01-27 14:34:26 -08:00
Sean McArthur
829563ccfc add read_bufs and write_bufs to Io and TcpStream 2017-01-27 11:32:08 -08:00
Alex Crichton
cf74a6b2c9 Merge pull request #159 from jtescher/fix-typos
Fix typos
2017-01-24 21:05:21 -08:00
Julian Tescher
baeb35b6d4
Fix typos 2017-01-24 20:52:48 -08:00
Alex Crichton
a4b4d57cb7 Touch up TcpStream::from_stream 2017-01-24 16:39:01 -08:00
Alex Crichton
4363663dea Merge pull request #158 from GuillaumeGomez/from_stream
Add from_stream method
2017-01-24 16:37:28 -08:00
Guillaume Gomez
c1f1320203 Add from_stream method 2017-01-24 23:49:50 +01:00
Alex Crichton
5b425dfed9 Remove unneeded macro_use 2017-01-23 20:16:12 -08:00
Alex Crichton
fcdeb0e5d6 Update crates.io metadata 2017-01-23 20:15:49 -08:00
Alex Crichton
75fe37bc8c Bump to 0.1.4 2017-01-23 20:14:28 -08:00
Alex Crichton
c9d0fe59dd Add a fast path to TcpListener::accept 2017-01-23 20:12:01 -08:00
Alex Crichton
b22b797278 Add a function to upgrade a Remote to a Handle
Intended for fast paths which can be a little more optimized for when they're
run directly on the event loop.
2017-01-23 20:11:37 -08:00
Alex Crichton
e69b67fcfe Remove extraneous clone in Remote 2017-01-23 20:06:03 -08:00
Manuel Woelker
b9e182a2ce impl fmt::Debug for EasyBuf (cf. #120)
Debug format looks like this for small resp. long buffers

EasyBuf{len=2/6 [5, 6]}
EasyBuf{len=255/255 [0, 1, 2, 3, ..., 251, 252, 253, 254]}
2017-01-22 21:10:48 +01:00
Alex Crichton
e8d4524586 Merge pull request #149 from vorner/loop_id
Provide a publicly-accessible Core ID
2017-01-18 15:33:55 -08:00
Michal 'vorner' Vaner
8d02a1c2b6
Provide a publicly-accessible Core ID
Allow distinguishing between multiple `Core`s and associating data with
them through a `HashMap` or similar.
2017-01-17 22:09:31 +01:00
Alex Crichton
9fe0bc1907 Merge pull request #145 from azdle/udp-codec-tweaks
UDP Codec Example Tweaks
2017-01-15 10:17:57 -08:00
Patrick Barrett
0c553f958a
return implicitly (rather than both explicitly and implicitly) 2017-01-14 13:00:46 -06:00
Patrick Barrett
e502603532
use the 'Out' type in encode rather than copy/paste 2017-01-14 12:59:22 -06:00
Alex Crichton
d0833074d6 Move from a custom channel to futures::sync
Closes #143
2017-01-11 11:35:45 -08:00
Alex Crichton
c47c445be6 Add some docs links and such 2017-01-11 09:47:12 -08:00
Alex Crichton
28ace4d33c Update docs/homepage link 2017-01-11 09:21:01 -08:00
Alex Crichton
1985eae7f5 Point to tokio.rs 2017-01-11 09:14:50 -08:00
Alex Crichton
f77fe7d3b5 Allow a bit of sloppiness in the timeout test 2017-01-10 16:14:54 -08:00
Alex Crichton
9294b1345c Touch up some docs in tokio-core 2017-01-10 10:02:15 -08:00
Alex Crichton
c61d3bc71e Merge pull request #144 from critiqjo/docs-fix
Docs: Remove outdated reference to `task::poll_on`
2017-01-09 21:19:10 -08:00
critiqjo
372d55ce0b Docs: Remove outdated reference to task::poll_on 2017-01-10 10:09:47 +05:30
Alex Crichton
2810471035 Update docs to docs.rs 2017-01-09 16:40:16 -08:00
Alex Crichton
76c3e162b7 Bump to 0.1.3 2017-01-06 11:39:38 -08:00
Alex Crichton
64c360c30e Touch up TcpStream::connect and revert breaking change 2017-01-06 11:37:46 -08:00
Alex Crichton
2499dd35a2 Merge branch 'master' of https://github.com/alreece45/tokio-core 2017-01-06 11:30:18 -08:00
Alex Crichton
4eb036d3f6 Merge pull request #141 from critiqjo/depr-fix
Update the use of deprecated APIs
2017-01-05 09:32:34 -08:00
critiqjo
e5bbf004d3 Update the use of deprecated APIs
For stuff that moved from futures::task to futures::executor
2017-01-05 20:41:36 +05:30
Alex Crichton
ff7fcd1074 Merge pull request #140 from SirVer/patch-1
Fix typo.
2017-01-04 08:43:00 -08:00
Alex Crichton
ae314245dc Merge pull request #139 from sinkuu/use_io_result
Use `io::Result`
2017-01-04 08:42:10 -08:00
Holger Rapp
58913c80a3 Fix typo. 2017-01-04 16:49:33 +01:00
sinkuu
5929a59aca Use io::Result 2017-01-04 17:47:20 +09:00
Alex Crichton
717e99ca80 Fix connect example 2016-12-20 18:39:44 -08:00
Alex Crichton
99078c5cc1 Touch up comments on echo, add connect example 2016-12-20 17:59:46 -08:00
Alexander Reece
3dd4178bb5 Update TcpStream::connect_stream() to return TcpStreamNew 2016-12-20 20:41:13 -05:00
Alexander Reece
000e9b5ab9 Change TcpStream::new() and TcpStream::connect() to return concrete types. 2016-12-20 20:41:13 -05:00
Alex Crichton
50f007a49b Add #![doc] to crate root 2016-12-19 22:41:41 -08:00