fix client example
This commit is contained in:
parent
d0f13ce5f9
commit
40837e4805
@ -10,7 +10,9 @@ tokio-rustls = { path = "../..", default-features = false, features = [ "tokio"
|
|||||||
|
|
||||||
tokio = "0.1"
|
tokio = "0.1"
|
||||||
tokio-core = "0.1"
|
tokio-core = "0.1"
|
||||||
tokio-file-unix = "0.4"
|
|
||||||
|
|
||||||
clap = "2.26"
|
clap = "2.26"
|
||||||
webpki-roots = "0.14"
|
webpki-roots = "0.14"
|
||||||
|
|
||||||
|
[target.'cfg(unix)'.dependencies]
|
||||||
|
tokio-file-unix = "0.4"
|
||||||
|
@ -19,9 +19,6 @@ use clap::{ App, Arg };
|
|||||||
use rustls::ClientConfig;
|
use rustls::ClientConfig;
|
||||||
use tokio_rustls::ClientConfigExt;
|
use tokio_rustls::ClientConfigExt;
|
||||||
|
|
||||||
#[cfg(not(unix))]
|
|
||||||
use std::io::{Read, Write};
|
|
||||||
|
|
||||||
fn app() -> App<'static, 'static> {
|
fn app() -> App<'static, 'static> {
|
||||||
App::new("client")
|
App::new("client")
|
||||||
.about("tokio-rustls client example")
|
.about("tokio-rustls client example")
|
||||||
@ -95,6 +92,7 @@ fn main() {
|
|||||||
// The network I/O will still be asynchronous and non-blocking.
|
// The network I/O will still be asynchronous and non-blocking.
|
||||||
#[cfg(not(unix))]
|
#[cfg(not(unix))]
|
||||||
{
|
{
|
||||||
|
use std::io::{ Read, Write };
|
||||||
use tokio::net::TcpStream;
|
use tokio::net::TcpStream;
|
||||||
|
|
||||||
let socket = TcpStream::connect(&addr);
|
let socket = TcpStream::connect(&addr);
|
||||||
|
Loading…
Reference in New Issue
Block a user