Removed deprecated code.

This commit is contained in:
Aaron Weiss 2015-11-22 16:26:43 -05:00
parent 6e160f561f
commit 11a54445b7
2 changed files with 4 additions and 3 deletions

View file

@ -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));
}
}

View file

@ -51,7 +51,7 @@ impl Connection<BufReader<NetStream>, BufWriter<NetStream>> {
fn connect_ssl_internal(host: &str, port: u16) -> Result<NetReadWritePair> {
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))))
}