diff --git a/examples/tweeter.rs b/examples/tweeter.rs index 81e92e5..465a0e2 100644 --- a/examples/tweeter.rs +++ b/examples/tweeter.rs @@ -2,7 +2,8 @@ extern crate irc; use std::default::Default; use std::sync::Arc; -use std::thread::{sleep_ms, spawn}; +use std::thread::{sleep, spawn}; +use std::time::Duration; use irc::client::prelude::*; fn main() { @@ -21,6 +22,6 @@ fn main() { }); loop { server.send_privmsg("#vana", "TWEET TWEET").unwrap(); - sleep_ms(10 * 1000); + sleep(Duration::new(10, 0)); } } diff --git a/src/client/conn.rs b/src/client/conn.rs index fbc93d6..a877651 100644 --- a/src/client/conn.rs +++ b/src/client/conn.rs @@ -51,7 +51,7 @@ impl Connection, BufWriter> { fn connect_ssl_internal(host: &str, port: u16) -> Result { let socket = try!(TcpStream::connect(&format!("{}:{}", host, port)[..])); let ssl = try!(ssl_to_io(SslContext::new(SslMethod::Tlsv1))); - let ssl_socket = try!(ssl_to_io(SslStream::new(&ssl, socket))); + let ssl_socket = try!(ssl_to_io(SslStream::connect_generic(&ssl, socket))); Ok((BufReader::new(NetStream::SslTcpStream(try!(ssl_socket.try_clone()))), BufWriter::new(NetStream::SslTcpStream(ssl_socket)))) }