Added concept of bot ownership, improved failure propagation.

This commit is contained in:
Aaron Weiss 2014-10-06 16:33:37 -04:00
parent 3475437fdb
commit 352a692c9b
3 changed files with 13 additions and 8 deletions

View file

@ -11,8 +11,7 @@ pub fn connect(host: &str, port: u16) -> IoResult<Connection> {
fn send_internal(conn: &Connection, msg: &str) -> IoResult<()> {
let &Connection(ref tcp) = conn;
let mut writer = BufferedWriter::new(tcp.clone());
writer.write_str(msg);
writer.flush()
writer.write_str(msg)
}
pub fn send(conn: &Connection, msg: Message) -> IoResult<()> {