@Override
	public void run() {
		try {
			if (!peerInitiatedConnection) {
				verifyHandshake();
			}
			else {
				getHandshake();
			}
		}
		catch (Exception e) {
			//System.out.println (ip_log + ":" + port_log + " no handshake given");
			noHandshakeGiven = true;
		}

		if (data.haveAllPackets() && !data.done) {
			data.endTimer();
		}

		try {
			dInputStream.close();
			inputStream.close();
			dOutputStream.close();
			outputStream.close();
			this.connectionSocket.close();
			if(data.DEBUG){
				if(noHandshakeGiven) {
					gui.main.messages.setText(gui.main.messages.getText() + "\n" + ip_log + ":" + port_log + " Never Gave Handshake (3 seconds)...Connection Closed");
				} else {
					gui.main.messages.setText(gui.main.messages.getText() + "\n" + ip_log + ":" + port_log + " Connection Closed");
				}
			}
			return;
		} 
		catch (IOException e1) {
			return;
		}
		catch (NullPointerException e2) {
			return;
		}

	}