forked from tokio-rs/tokio
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move tokio::net module into tokio tcp/udp crates (tokio-rs#224)
- Loading branch information
1 parent
64435f5
commit 923a80e
Showing
29 changed files
with
312 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# 0.1.0 (unreleased) | ||
|
||
* Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[package] | ||
name = "tokio-tcp" | ||
|
||
# When releasing to crates.io: | ||
# - Update html_root_url. | ||
# - Update CHANGELOG.md. | ||
# - Create "v0.1.x" git tag. | ||
version = "0.1.0" | ||
authors = ["Carl Lerche <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/tokio-rs/tokio" | ||
homepage = "https://tokio.rs" | ||
documentation = "https://docs.rs/tokio-tcp/0.1" | ||
description = """ | ||
TCP bindings for tokio. | ||
""" | ||
categories = ["asynchronous"] | ||
|
||
[dependencies] | ||
tokio-io = { version = "0.1.6", path = "../tokio-io" } | ||
tokio-reactor = { version = "0.1.0", path = "../tokio-reactor" } | ||
bytes = "0.4" | ||
mio = "0.6.14" | ||
iovec = "0.1" | ||
futures = "0.1.18" | ||
futures2 = { version = "0.1", path = "../futures2", optional = true } | ||
|
||
[dev-dependencies] | ||
env_logger = { version = "0.4", default-features = false } | ||
|
||
[features] | ||
unstable-futures = ["futures2"] | ||
default = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Copyright (c) 2018 Tokio Contributors | ||
|
||
Permission is hereby granted, free of charge, to any | ||
person obtaining a copy of this software and associated | ||
documentation files (the "Software"), to deal in the | ||
Software without restriction, including without | ||
limitation the rights to use, copy, modify, merge, | ||
publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software | ||
is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice | ||
shall be included in all copies or substantial portions | ||
of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF | ||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | ||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | ||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT | ||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR | ||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# tokio-tcp | ||
|
||
TCP bindings for `tokio`. | ||
|
||
[Documentation](https://tokio-rs.github.io/tokio/tokio_tcp/) | ||
|
||
## License | ||
|
||
This project is licensed under the [MIT license](./LICENSE). | ||
|
||
### Contribution | ||
|
||
Unless you explicitly state otherwise, any contribution intentionally submitted | ||
for inclusion in Tokio by you, shall be licensed as MIT, without any additional | ||
terms or conditions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
//! TCP bindings for `tokio`. | ||
//! | ||
//! This module contains the TCP networking types, similar to the standard | ||
//! library, which can be used to implement networking protocols. | ||
//! | ||
//! Connecting to an address, via TCP, can be done using [`TcpStream`]'s | ||
//! [`connect`] method, which returns [`ConnectFuture`]. `ConnectFuture` | ||
//! implements a future which returns a `TcpStream`. | ||
//! | ||
//! To listen on an address [`TcpListener`] can be used. `TcpListener`'s | ||
//! [`incoming`][incoming_method] method can be used to accept new connections. | ||
//! It return the [`Incoming`] struct, which implements a stream which returns | ||
//! `TcpStream`s. | ||
//! | ||
//! [`TcpStream`]: struct.TcpStream.html | ||
//! [`connect`]: struct.TcpStream.html#method.connect | ||
//! [`ConnectFuture`]: struct.ConnectFuture.html | ||
//! [`TcpListener`]: struct.TcpListener.html | ||
//! [incoming_method]: struct.TcpListener.html#method.incoming | ||
//! [`Incoming`]: struct.Incoming.html | ||
#![doc(html_root_url = "https://docs.rs/tokio-tcp/0.1.0")] | ||
#![deny(missing_docs, warnings, missing_debug_implementations)] | ||
|
||
extern crate bytes; | ||
#[macro_use] | ||
extern crate futures; | ||
extern crate iovec; | ||
extern crate mio; | ||
extern crate tokio_io; | ||
extern crate tokio_reactor; | ||
|
||
#[cfg(feature = "unstable-futures")] | ||
extern crate futures2; | ||
|
||
mod incoming; | ||
mod listener; | ||
mod stream; | ||
|
||
pub use self::incoming::Incoming; | ||
pub use self::listener::TcpListener; | ||
pub use self::stream::TcpStream; | ||
pub use self::stream::ConnectFuture; | ||
|
||
#[cfg(feature = "unstable-futures")] | ||
fn lift_async<T>(old: futures::Async<T>) -> futures2::Async<T> { | ||
match old { | ||
futures::Async::Ready(x) => futures2::Async::Ready(x), | ||
futures::Async::NotReady => futures2::Async::Pending, | ||
} | ||
} | ||
|
||
#[cfg(feature = "unstable-futures")] | ||
fn lower_async<T>(new: futures2::Async<T>) -> futures::Async<T> { | ||
match new { | ||
futures2::Async::Ready(x) => futures::Async::Ready(x), | ||
futures2::Async::Pending => futures::Async::NotReady, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.