X-Git-Url: http://git.euphorik.ch/?p=crypto_lab1.git;a=blobdiff_plain;f=src%2Fclient.rs;fp=src%2Fclient.rs;h=575df0509538729a748c50c4c3165b30046c877d;hp=8392460e433169e5b74415a8b932efab6d5cb649;hb=3a33f82b92400ffabdc5fd7bdcbdc9f888277418;hpb=aee28ef5d1be59c0db218d7130fd1ae2314cc970 diff --git a/src/client.rs b/src/client.rs index 8392460..575df05 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,10 +1,8 @@ use std::io::{ TcpStream, IoResult }; use command::{ Command, Packet, Error }; -use crypto::Crypto; pub struct Client { socket: TcpStream, - crypto: Crypto, current_timestamp: u64 } @@ -12,8 +10,7 @@ impl Client { pub fn new(address: &str, port: u16) -> IoResult { Ok(Client { socket: try!(TcpStream::connect(address, port)), - current_timestamp: 0, - crypto: Crypto::new() + current_timestamp: 0 }) } @@ -24,7 +21,7 @@ impl Client { pub fn start_tests(&mut self) { - let command = Packet::newRandomCommand(self.current_timestamp); + let command = Packet::new_random_command(self.current_timestamp); self.send(command); }