mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
Move binaries to examples
This commit is contained in:
parent
6c6fb917ee
commit
02538d035f
@ -1,5 +1,6 @@
|
|||||||
//! An echo server that just writes back everything that's written to it.
|
//! An echo server that just writes back everything that's written to it.
|
||||||
|
|
||||||
|
extern crate env_logger;
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate tokio_core;
|
extern crate tokio_core;
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ use tokio_core::Loop;
|
|||||||
use tokio_core::io::{copy, TaskIo};
|
use tokio_core::io::{copy, TaskIo};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
env_logger::init().unwrap();
|
||||||
let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string());
|
let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string());
|
||||||
let addr = addr.parse::<SocketAddr>().unwrap();
|
let addr = addr.parse::<SocketAddr>().unwrap();
|
||||||
|
|
@ -3,7 +3,7 @@
|
|||||||
//! There is no concurrency in this server, only one connection is written to at
|
//! There is no concurrency in this server, only one connection is written to at
|
||||||
//! a time.
|
//! a time.
|
||||||
|
|
||||||
#[macro_use]
|
extern crate env_logger;
|
||||||
extern crate futures;
|
extern crate futures;
|
||||||
extern crate tokio_core;
|
extern crate tokio_core;
|
||||||
|
|
||||||
@ -16,6 +16,7 @@ use futures::stream::{self, Stream};
|
|||||||
use tokio_core::io::IoFuture;
|
use tokio_core::io::IoFuture;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
env_logger::init().unwrap();
|
||||||
let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string());
|
let addr = env::args().nth(1).unwrap_or("127.0.0.1:8080".to_string());
|
||||||
let addr = addr.parse::<SocketAddr>().unwrap();
|
let addr = addr.parse::<SocketAddr>().unwrap();
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user