@Override
	public void run() {
		try {
			//opens sockets
			peer.connect();
			out = new DataOutputStream(peer.getSocket().getOutputStream());
			in = new DataInputStream(peer.getSocket().getInputStream());	
			managePeerConnection();
		} catch(SocketTimeoutException ste){
			System.err.println("Socket for peer: " + this.peer + " timed out. Disconnecting from peer.");
			try {
				closeConnections();
			} catch (IOException e) {
				System.err.println("meta-exception, couldnt close connections after exception was already thrown.");
				e.printStackTrace();
			}
		} catch (IOException e){
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}