--- /dev/null
+use std::io::{ TcpStream, IoResult };
+use command::{ Command, Packet, Error };
+use crypto::Crypto;
+
+pub struct Client {
+ socket: TcpStream,
+ crypto: Crypto,
+ current_timestamp: u64
+}
+
+impl Client {
+ pub fn new(address: &str, port: u16) -> IoResult<Client> {
+ Ok(Client {
+ socket: try!(TcpStream::connect(address, port)),
+ current_timestamp: 0,
+ crypto: Crypto::new()
+ })
+ }
+
+ pub fn close(&mut self) {
+ self.socket.close_read();
+ self.socket.close_write();
+ }
+
+ pub fn start_tests(&mut self) {
+
+ let command = Packet::newRandomCommand(self.current_timestamp);
+ self.send(command);
+
+ }
+
+ fn send(&mut self, p: Packet) {
+ p.write(&mut self.socket);
+ }
+}
\ No newline at end of file